@anmol0493/fullstack-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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/setup.js +14 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmol0493/fullstack-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A full-stack template with Vite React frontend and Express/NestJS backend options.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/scripts/setup.js CHANGED
@@ -16,19 +16,26 @@ const __dirname = dirname(__filename);
16
16
  const projectName = process.argv[2];
17
17
 
18
18
  if (!projectName) {
19
- console.error('Please provide a project name:');
20
- console.error(' npx @anmol040903/fullstack-app <project-name>');
19
+ console.error('Please provide a project name');
21
20
  process.exit(1);
22
21
  }
23
22
 
24
23
  // Define paths
25
24
  const templateDir = path.join(__dirname, '..'); // Root directory of your template
26
- const targetDir = path.resolve(process.cwd(), projectName);
25
+ let targetDir;
27
26
 
28
- // Ensure the target directory doesn't already exist
29
- if (fs.existsSync(targetDir)) {
30
- console.error(`Directory "${projectName}" already exists.`);
31
- process.exit(1);
27
+ if (projectName === '.') {
28
+ // Use the current working directory if "." is provided
29
+ targetDir = process.cwd();
30
+ } else {
31
+ // Otherwise, create a new directory with the given project name
32
+ targetDir = path.resolve(process.cwd(), projectName);
33
+
34
+ // Ensure the target directory doesn't already exist
35
+ if (fs.existsSync(targetDir)) {
36
+ console.error(`Directory "${projectName}" already exists.`);
37
+ process.exit(1);
38
+ }
32
39
  }
33
40
 
34
41
  (async () => {