forked from rockybars/atom-shell-packager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·27 lines (21 loc) · 730 Bytes
/
cli.js
File metadata and controls
executable file
·27 lines (21 loc) · 730 Bytes
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
#!/usr/bin/env node
'use strict'
var common = require('./common')
var fs = require('fs')
var packager = require('./')
var path = require('path')
var usage = fs.readFileSync(path.join(__dirname, 'usage.txt')).toString()
var args = common.parseCLIArgs(process.argv.slice(2))
if (!args.dir || (!args.all && (!args.platform || !args.arch))) {
console.error(usage)
process.exit(1)
}
packager(args, function done (err, appPaths) {
if (err) {
if (err.message) console.error(err.message)
else console.error(err, err.stack)
process.exit(1)
}
if (appPaths.length > 1) console.error('Wrote new apps to:\n' + appPaths.join('\n'))
else if (appPaths.length === 1) console.error('Wrote new app to', appPaths[0])
})