forked from gligoran/cordova-set-version
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·44 lines (35 loc) · 993 Bytes
/
cli.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
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
import meow from 'meow';
import cordovaSetVersion from './index.js';
const help = `
Usage
$ cordova-set-version [-v|--version <version>] [-b|--build-number <build-number|"date">] [config.xml]
Options
-v, --version Version to set
-b, --build-number Build number to set, or "date" to use Unix timestamp in seconds
Examples
$ cordova-set-version -v 2.4.9
$ cordova-set-version -b 86
$ cordova-set-version -v 2.4.9 -b 86
$ cordova-set-version -v 2.4.9 -b date
`;
const options = {
importMeta: import.meta,
flags: {
version: {
type: 'string',
alias: 'v',
},
buildNumber: {
type: 'string',
alias: 'b',
},
},
help,
autoVersion: false,
};
const cli = meow(options);
const configPath = cli.input[0] || null;
const version = cli.flags.version || null;
const buildNumber = cli.flags.buildNumber || null;
cordovaSetVersion({ configPath, version, buildNumber });