-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathstencil-pull.js
More file actions
executable file
·40 lines (34 loc) · 1.26 KB
/
stencil-pull.js
File metadata and controls
executable file
·40 lines (34 loc) · 1.26 KB
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
#!/usr/bin/env node
require('colors');
const { PACKAGE_INFO, API_HOST } = require('../constants');
const program = require('../lib/commander');
const StencilPull = require('../lib/stencil-pull');
const { checkNodeVersion } = require('../lib/cliCommon');
const { printCliResultErrorAndExit } = require('../lib/cliCommon');
program
.version(PACKAGE_INFO.version)
.option('-s, --saved', 'get the saved configuration instead of the active one')
.option('-h, --host [hostname]', 'specify the api host', API_HOST)
.option(
'-f, --filename [filename]',
'specify the filename to save the config as',
'config.json',
)
.option(
'-c, --channel_id [channelId]',
'specify the channel ID of the storefront to pull configuration from',
parseInt,
)
.option('-a, --activate [variationname]', 'specify the variation of the theme to activate')
.parse(process.argv);
checkNodeVersion();
const cliOptions = program.opts();
const options = {
apiHost: cliOptions.host || API_HOST,
saveConfigName: cliOptions.filename,
channelId: cliOptions.channel_id,
saved: cliOptions.saved || false,
applyTheme: true,
activate: cliOptions.activate,
};
new StencilPull().run(options).catch(printCliResultErrorAndExit);