Skip to content

Commit 4832e01

Browse files
committed
fixed template dir bug
1 parent 2318816 commit 4832e01

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

scripts/constants.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
const path = require("path");
21
const CLEAN_NPM_CACHE = "npm cache clean --force";
32
const SPECIALCHAR = RegExp("/[!@#$%^&*()-=_,.?~:;\\{}|<>]/g");
43
const UNNECESSORYFOLDERS = RegExp("^node_modules|build|dist$", "i");
5-
const TEMPLATE_PATH = path.join(__dirname, "../template");
64

75
module.exports = {
86
CLEAN_NPM_CACHE,
97
SPECIALCHAR,
10-
TEMPLATE_PATH,
118
UNNECESSORYFOLDERS
129
};

scripts/create.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require("path");
22
const { copyDirectory, ErrorMessage, SuccessMessage } = require("./helper");
3-
const { CLEAN_NPM_CACHE, SPECIALCHAR, TEMPLATE_PATH } = require("./constants");
3+
const { CLEAN_NPM_CACHE, SPECIALCHAR } = require("./constants");
44
const {
55
installDependencies,
66
getDependencies,
@@ -22,6 +22,7 @@ if (dirName[0].match("^[A-Z0-9]")) {
2222
);
2323
} else {
2424
//using process.cwd for getting current path
25+
const TEMPLATE_PATH = path.join(__dirname, "../template");
2526
let destination = path.join(process.cwd() + "/" + args[0]);
2627
copyDirectory(TEMPLATE_PATH, destination);
2728

0 commit comments

Comments
 (0)