-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepos.js
More file actions
32 lines (28 loc) · 804 Bytes
/
repos.js
File metadata and controls
32 lines (28 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { adjectives } from "./adjectives";
import { people } from "./people";
import * as scmClient from "./scm";
const types = [
"git", "svn", "hg"
];
const createRepository = () => {
const adjective = pickRandom(adjectives);
const person = pickRandom(people);
const contact = `${adjective}.${person.name}@scm-manager.org`;
const type = pickRandom(types);
return {
name: person.name,
namespace: adjective,
description: person.description,
contact,
type
};
};
const pickRandom = (array) => {
return array[Math.floor(Math.random() * array.length)];
};
export const createRepositories = () => {
for (let i=0; i<256; i++) {
const repository = createRepository();
scmClient.createRepository(repository);
}
};