create-elseware-nodejs-app 1.0.0 → 1.0.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/README.md CHANGED
@@ -1 +1 @@
1
- # create-elseware-app
1
+ # create-elseware-nodejs-app
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ async function generateProject({ targetDir, options }) {
52
52
  fs.mkdirSync(targetDir, { recursive: true });
53
53
  copyRecursive(templateDir, targetDir);
54
54
  updatePackageJson(targetDir, options);
55
+ createEnvFile(targetDir);
55
56
  }
56
57
  function copyRecursive(src, dest) {
57
58
  for (const entry of fs.readdirSync(src)) {
@@ -77,6 +78,17 @@ function updatePackageJson(targetDir, options) {
77
78
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
78
79
  logger.success("package.json configured");
79
80
  }
81
+ function createEnvFile(targetDir) {
82
+ const examplePath = path.join(targetDir, ".env.example");
83
+ const envPath = path.join(targetDir, ".env");
84
+ if (!fs.existsSync(examplePath)) {
85
+ return;
86
+ }
87
+ if (fs.existsSync(envPath)) {
88
+ return;
89
+ }
90
+ fs.copyFileSync(examplePath, envPath);
91
+ }
80
92
 
81
93
  // src/create.ts
82
94
  async function createProject(projectName2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-elseware-nodejs-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI to scaffold Elseware NodeJS applications",
5
5
  "type": "module",
6
6
  "private": false,