windowpp 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/windowpp.js +3 -2
- package/lib/create.js +11 -3
- package/package.json +1 -1
package/bin/windowpp.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Global install: npm install -g windowpp
|
|
5
5
|
// Usage:
|
|
6
|
-
// windowpp create <name> [--template solid] [--out-dir .]
|
|
6
|
+
// windowpp create <name> [--template solid] [--out-dir .] [--no-run]
|
|
7
7
|
// windowpp build [--clean] [--app-dir .] [--config Release|Debug]
|
|
8
8
|
// windowpp dev [--clean] [--app-dir .] [--port 3000]
|
|
9
9
|
|
|
@@ -24,6 +24,7 @@ function parseFlags(args) {
|
|
|
24
24
|
else if (a === '--template' && args[i + 1]) { flags.template = args[++i]; }
|
|
25
25
|
else if (a === '--config' && args[i + 1]) { flags.config = args[++i]; }
|
|
26
26
|
else if (a === '--port' && args[i + 1]) { flags.port = parseInt(args[++i], 10); }
|
|
27
|
+
else if (a === '--no-run') { flags.noRun = true; }
|
|
27
28
|
}
|
|
28
29
|
return flags;
|
|
29
30
|
}
|
|
@@ -51,7 +52,7 @@ switch (command) {
|
|
|
51
52
|
}
|
|
52
53
|
const flags = parseFlags(args.slice(2));
|
|
53
54
|
const { create } = require('../lib/create');
|
|
54
|
-
create(name, { template: flags.template, outDir: flags.outDir }).catch((err) => {
|
|
55
|
+
create(name, { template: flags.template, outDir: flags.outDir, autoRun: !flags.noRun }).catch((err) => {
|
|
55
56
|
console.error(err.message || err);
|
|
56
57
|
process.exit(1);
|
|
57
58
|
});
|
package/lib/create.js
CHANGED
|
@@ -140,9 +140,17 @@ async function create(name, options = {}) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
console.log(`\n-- Created "${name}"\n`);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
|
|
144
|
+
if (options.autoRun !== false) {
|
|
145
|
+
console.log('Starting dev mode...\n');
|
|
146
|
+
const { dev } = require('./dev');
|
|
147
|
+
process.chdir(appDir);
|
|
148
|
+
dev({ clean: false });
|
|
149
|
+
} else {
|
|
150
|
+
console.log('Next steps:');
|
|
151
|
+
console.log(` cd ${name}`);
|
|
152
|
+
console.log(' windowpp dev\n');
|
|
153
|
+
}
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
module.exports = { create };
|