diff --git a/create.js b/create.js index b8b6b03..b126be4 100644 --- a/create.js +++ b/create.js @@ -27,11 +27,6 @@ if (!fs.existsSync(appDir)) { fs.mkdirSync(`${appDir}/src`); } -// rename internal files -fs.renameSync(`${rootDir}/source/shared/npmrc`, `${rootDir}/source/shared/.npmrc`); -fs.renameSync(`${rootDir}/source/shared/gitignore`, `${rootDir}/source/shared/.gitignore`); -fs.renameSync(`${rootDir}/source/shared/prettierrc`, `${rootDir}/source/shared/.prettierrc`); - // copy folder content try { fs.cpSync(`${rootDir}/source/shared/`, contextDir, { @@ -46,6 +41,12 @@ try { console.error(err); } +// rename internal files +fs.unlinkSync('.npmrc'); +fs.renameSync(`${contextDir}/npmrc`, `${contextDir}/.npmrc`); +fs.renameSync(`${contextDir}/gitignore`, `${contextDir}/.gitignore`); +fs.renameSync(`${contextDir}/prettierrc`, `${contextDir}/.prettierrc`); + // replace in files replaceInFiles.sync({ files: `./${contextDir}/**/*.{ts,tsx}`,