forked from megahertz/electron-simple-publisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·44 lines (38 loc) · 1.05 KB
/
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
38
39
40
41
42
43
44
#! /usr/bin/env node
'use strict';
const getOptionsFromCli = require('./lib/utils/get-options-from-cli');
const publisher = require('./lib/publisher');
const cliOptions = getOptionsFromCli(process.argv.slice(2));
module.exports = publisher;
if (require.main === module) {
publisher.run(cliOptions)
.then((result) => {
switch (cliOptions.command) {
case 'publish': {
console.log('All releases have been successfully published');
break;
}
case 'replace': {
console.log('All releases have been successfully replaced');
break;
}
case 'list': {
console.log('Builds on the hosting:');
console.log(result.join(' '));
break;
}
case 'remove': {
console.log('All specified releases have been successfully removed');
break;
}
}
})
.catch(e => {
if (cliOptions.debug) {
console.error(e);
} else {
console.error(e.message);
}
process.exit(1);
});
}