forked from blackbaud/skyux-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (31 loc) · 815 Bytes
/
index.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
'use strict';
const logger = require('@blackbaud/skyux-logger');
const deploy = require('./lib/deploy');
const publish = require('./lib/publish');
const settings = require('./lib/settings');
function exit() {
process.exit(1);
}
/**
* Verifies version + assets, then adds to blob + table storage.
* @name processArgs
* @param {Object} argv
* @returns null
*/
function processArgv(argv) {
const options = settings.getSettings(argv);
logger.info('SPA Name: %s', options.name);
logger.info('SPA Version: %s', options.version);
switch (argv._[0]) {
case 'deploy':
deploy(options).catch(exit);
break;
case 'publish':
publish(options).catch(exit);
break;
default:
logger.info('Unknown skyux-deploy command.');
break;
}
}
module.exports = processArgv;