Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 17b9d82

Browse files
authored
fix(scripts): respect tns build/run args passed to ns-bundle (#71)
1 parent e80cbdc commit 17b9d82

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Diff for: bin/ns-bundle

+17-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,25 @@ if (!process.env.npm_config_argv) {
1010
}
1111

1212
const npmArgs = JSON.parse(process.env.npm_config_argv).original;
13+
const tnsArgs = getTnsArgs(npmArgs);
1314
const flags = npmArgs.filter(a => a.startsWith("--")).map(a => a.substring(2));
1415
const options = getOptions(flags);
1516

17+
function getTnsArgs(args) {
18+
let other = [
19+
"run",
20+
"ns-bundle",
21+
"--android",
22+
"--ios",
23+
"--build-app",
24+
"--start-app",
25+
"--uglify",
26+
"--nobundle",
27+
];
28+
29+
return args.filter(a => !other.includes(a));
30+
}
31+
1632
execute(options);
1733

1834
function execute(options) {
@@ -41,7 +57,7 @@ function webpack(platform) {
4157
function runTns(command, platform) {
4258
console.log(`Running tns ${command}...`);
4359
return new Promise((resolve, reject) => {
44-
spawnChildProcess("tns", command, platform, "--bundle", "--disable-npm-install")
60+
spawnChildProcess("tns", command, platform, "--bundle", "--disable-npm-install", ...tnsArgs)
4561
.then(resolve)
4662
.catch(throwError);
4763
});

0 commit comments

Comments
 (0)