forked from pointnetwork/pointnetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint
More file actions
executable file
·25 lines (23 loc) · 794 Bytes
/
point
File metadata and controls
executable file
·25 lines (23 loc) · 794 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
#!/usr/bin/env node
var path = require('path');
let prepare = '';
if (process.argv.length >= 3 && process.argv[2] === 'deploy'){
prepare = 'cd ' + process.argv[1].slice(0, process.argv[1].length - 6) + ' && ';
if (process.argv.length >= 4) {
if (process.argv[3].startsWith('-')) {
// it's a flag, path is empty, add the current path after everything
process.argv.push(path.resolve('.'));
} else {
// modify: relative -> absolute path
process.argv[3] = path.resolve(process.argv[3]);
}
} else {
// empty path
process.argv.push(path.resolve('.'));
}
}
require('child_process').spawnSync(
prepare + 'node dist/index.js',
process.argv.slice(2),
{stdio: 'inherit', shell: true}
);