-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-blueprints.mjs
executable file
·53 lines (47 loc) · 1.19 KB
/
update-blueprints.mjs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env node
'use strict';
import gitDiffApply from 'git-diff-apply';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
const CURRENT_VERSION = '0.6.1';
async function updateBlueprints({ from, to }) {
const startTag = from;
const endTag = to;
try {
await gitDiffApply({
cwd: process.cwd(),
endTag,
ignoredFiles: ['CHANGELOG.md'],
remoteUrl: 'https://github.com/ijlee2/blueprints-v2-addon-output/',
startTag,
});
} catch (error) {
console.error(`git-diff-apply: ${error}`);
}
}
// Provide a title to the process in `ps`
process.title = 'update-blueprints';
yargs(hideBin(process.argv))
.command({
builder: (yargs) => {
return yargs
.option('from', {
default: CURRENT_VERSION,
describe: "The start version (e.g. '0.1.0')",
type: 'string',
})
.option('to', {
describe: "The end version (e.g. '0.2.0')",
type: 'string',
})
.demandOption(['to']);
},
command: '*',
describe: 'Updates the blueprints for v2 addons',
handler: (argv) => {
updateBlueprints(argv);
},
})
.demandCommand()
.strict()
.parseSync();