create-spine 1.0.1 → 1.0.2
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/index.js +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const path = require("path");
|
|
4
|
+
const { execSync } = require("child_process");
|
|
4
5
|
|
|
5
6
|
const projectName = process.argv[2] || "my-spinekit-app";
|
|
6
7
|
const templateDir = path.join(__dirname, "template");
|
|
@@ -12,9 +13,11 @@ if (fs.existsSync(targetDir)) {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
fs.cpSync(templateDir, targetDir, { recursive: true });
|
|
15
|
-
|
|
16
16
|
console.log(`\nCreated ${projectName}`);
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
console.log(`\nInstalling dependencies...\n`);
|
|
19
|
+
execSync("npm install", { cwd: targetDir, stdio: "inherit" });
|
|
20
|
+
|
|
21
|
+
console.log(`\nAll done! Run this to start:`);
|
|
18
22
|
console.log(` cd ${projectName}`);
|
|
19
|
-
console.log(` npm install`);
|
|
20
23
|
console.log(` npm run dev\n`);
|