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

Commit da28d43

Browse files
committed
fix(ns-bundle): parse all '*-app' flags as tns commands
Allows for using --publish-app along with --start-app, --build-app, etc.
1 parent ae40f93 commit da28d43

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Diff for: bin/ns-bundle

+6-10
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ function getTnsArgs(args) {
2323
"ns-bundle",
2424
"--android",
2525
"--ios",
26-
"--build-app",
27-
"--start-app",
2826
"--uglify",
2927
"--nobundle",
3028
];
3129

32-
return args.filter(a => !other.includes(a));
30+
return args.filter(a => !other.includes(a) && !a.endsWith("--app"));
3331
}
3432

3533
function escape(arg) {
@@ -179,15 +177,13 @@ function getPlatform(flags) {
179177
}
180178

181179
function getCommand(flags) {
182-
if (flags.includes("start-app") && flags.includes("build-app")) {
183-
throwError({message: "You cannot use both --start-app and --build-app flags!"});
180+
const commands = flags.filter(f => f.endsWith("-app"));
181+
if (commands.length > 1) {
182+
throwError({message: `You can't use ${commands.join(", ")} together!`});
184183
}
185184

186-
if (flags.includes("start-app")) {
187-
return "run";
188-
} else if (flags.includes("build-app")) {
189-
return "build";
190-
}
185+
// remove '-app' suffix
186+
return commands[0].replace(/-app/, "");
191187
}
192188

193189
function spawnChildProcess(command, ...args) {

0 commit comments

Comments
 (0)