Better win compatibility for bb-server frontent
parent
252a761005
commit
73619b0c9e
|
@ -1,15 +1,26 @@
|
|||
#!/usr/bin/env node
|
||||
const { execFileSync } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
const isWin = (process.platform === 'win32');
|
||||
|
||||
const bundlejs = 'src/app/bundle.js'
|
||||
const bundlets = 'src/app/bundle.d.ts'
|
||||
|
||||
const npm = isWin ? 'npm.cmd' : 'npm';
|
||||
|
||||
|
||||
var args = process.argv.slice(2).map(function(x) {
|
||||
return path.normalize(x);
|
||||
});
|
||||
|
||||
|
||||
var pbjs_args = [
|
||||
'-t', 'static-module', '-w', 'commonjs', '-o', bundlejs
|
||||
].concat(process.argv.slice(2));
|
||||
].concat(args);
|
||||
|
||||
console.log("Running pbjs " + pbjs_args.join(" "));
|
||||
var out = execFileSync('pbjs', pbjs_args);
|
||||
var out = execFileSync(npm, ['run', 'pbjs', '--'].concat(pbjs_args));
|
||||
console.log("" + out);
|
||||
|
||||
var pbts_args = [
|
||||
|
@ -17,5 +28,5 @@ var pbts_args = [
|
|||
];
|
||||
|
||||
console.log("Running pbts " + pbts_args.join(" "));
|
||||
out = execFileSync('pbts', pbts_args);
|
||||
out = execFileSync(npm, ['run', 'pbts', '--'].concat(pbts_args));
|
||||
console.log("" + out);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"lint": "ng e2e",
|
||||
"pbts": "pbts",
|
||||
"pbjs": "pbjs",
|
||||
"protoc" : "./generate-protobuf.js"
|
||||
"protoc" : "node ./generate-protobuf.js"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue