-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
35 lines (31 loc) · 1.27 KB
/
config.js
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
33
34
35
const configData = require('./config.json');
const path = require('path');
// location of our temporary repo storage
function getRepoStorageDir() {
return path.join(__dirname, '..', 'tpw_clients');
}
const repos = configData.repos.map((x) => {
return {
// copy all properties from config.json
...x,
// generate a local path for our temporary git repo to be stored
localPath: path.join(getRepoStorageDir(), `tpw_${x.id}`),
additionalProperties: {
...x.additionalProperties || {},
// generate some standard properties (if they don't already exist)
projectRepository: x.additionalProperties?.projectRepository || x.url,
projectLicense: x.additionalProperties?.projectLicense || "MIT",
projectOrganization: x.additionalProperties?.projectOrganization || "ThemeParks",
projectDescription: x.additionalProperties?.projectDescription || `A ${x.name} client for the ThemeParks.Wiki API`,
projectName: x.additionalProperties?.projectName || "themeparks",
name: x.additionalProperties?.name || "themeparks",
}
};
});
function getRepos() {
return repos;
}
module.exports = {
getRepos,
getRepoStorageDir,
};