-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.js
31 lines (22 loc) · 943 Bytes
/
generate.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
const fs = require('fs');
const javascript = require('./generators/javascript.js');
const php = require('./generators/php.js');
const python = require('./generators/python.js');
const ruby = require('./generators/ruby.js');
const source = require('./source.js');
const { interpolatify } = require('./utilities.js');
const generate = async () => {
const blueprints = await source();
await javascript(blueprints);
await php(blueprints);
await python(blueprints);
await ruby(blueprints);
const readme = interpolatify`
${blueprints.readme.global.replace('CODE_DEMO', 'Available for JavaScript, PHP, Python and Ruby.')
.replace('CURRENT_LOCALES', blueprints.locales.map(locale => `\`${locale}\``).join(', '))}
## Documentation
Visit the language subfolders in this repository for language-specific documentation.
`;
await fs.promises.writeFile('README.md', readme);
};
generate();