1 | import Util from 'util';
|
2 | import Package from './package.json';
|
3 | import ChildProcess from 'child_process';
|
4 |
|
5 | const Exec = Util.promisify(ChildProcess.exec);
|
6 |
|
7 | (async function () {
|
8 |
|
9 | const commands = [
|
10 | 'npm run dev',
|
11 | 'npm run dst',
|
12 | 'rm -r ./docs/*',
|
13 | 'muleify -p ./web ./docs',
|
14 | 'git add .',
|
15 | `git commit -m "${Package.version}"`,
|
16 | 'git push',
|
17 | 'npm publish'
|
18 | ];
|
19 |
|
20 | for (const command of commands) {
|
21 |
|
22 | const { stdout, stderr } = await Exec(command);
|
23 |
|
24 | if (stdout) console.log(stdout);
|
25 | if (stderr) console.warn(stderr);
|
26 |
|
27 | }
|
28 |
|
29 | }()).catch(function (error) {
|
30 | console.error(error.message);
|
31 | });
|