create-uk-node-server 1.1.0 → 1.1.1
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 +10 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -18,8 +18,14 @@ async function main() {
|
|
18
18
|
type: "input",
|
19
19
|
name: "projectName",
|
20
20
|
message: "Enter the name of your project",
|
21
|
-
default: "
|
22
|
-
}
|
21
|
+
default: ""
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: "input",
|
25
|
+
name: "description",
|
26
|
+
message: "Enter the description of your project",
|
27
|
+
default: "A new nodejs project"
|
28
|
+
},
|
23
29
|
]);
|
24
30
|
|
25
31
|
const templatePath = path.join(__dirname, "templates", answers.language.toLowerCase());
|
@@ -29,7 +35,8 @@ async function main() {
|
|
29
35
|
if (err) return console.error(err)
|
30
36
|
const pkgPath = path.join(projectPath, "package.json");
|
31
37
|
const pkg = fs.readJsonSync(pkgPath);
|
32
|
-
pkg.name = answers.projectName;
|
38
|
+
pkg.name = answers.projectName.toLowerCase() || process.cwd().replace(/\\/g, "/").split("/").pop().toLowerCase();
|
39
|
+
pkg.description = answers.description;
|
33
40
|
fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });
|
34
41
|
console.log("Installing dependencies...")
|
35
42
|
execSync(`cd ${projectPath} && npm install`);
|