Skip to content

Commit 2b5127a

Browse files
committed
[Issue #14] - Checking builder.shouldBuild() is not idempotent
1 parent 70d8674 commit 2b5127a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- [Issue #14] - Checking builder.shouldBuild() is not idempotent
78
- [Issue #13] - html-to-app fails if out-of-source build, with -f, and dist folder already existing
89
- [Issue #12] - html-to-app -c should kill program after creating config file
910

lib/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ if (cli.args.createConfig) {
113113
// Append properties to payload
114114
payload.build.force = cli.args.forceBuild;
115115

116+
// Check if we need to build
117+
let shouldBuild = builder.shouldBuild() || cli.args.forceBuild;
118+
116119
// Start the engine
117120
console.log("Importing...");
118121
executeCommand(importer.precmd);
@@ -125,7 +128,7 @@ importer.run(payload)
125128
})
126129
.then((payload) => {
127130
executeCommand(converter.postcmd);
128-
if (builder.shouldBuild() || cli.args.forceBuild) {
131+
if (shouldBuild) {
129132
executeCommand(builder.precmd);
130133
console.log("Building...");
131134
return builder.run(payload);
@@ -136,7 +139,7 @@ importer.run(payload)
136139
}
137140
})
138141
.then((payload) => {
139-
if (builder.shouldBuild() || cli.args.forceBuild) {
142+
if (shouldBuild) {
140143
executeCommand(builder.postcmd);
141144
}
142145
executeCommand(exporter.precmd);

0 commit comments

Comments
 (0)