@ahmadubaidillah/core 1.1.6 → 1.1.7
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/dist/index.js +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26498,7 +26498,12 @@ var { copySync, readFileSync: readFileSync2, writeFileSync, existsSync: existsSy
|
|
|
26498
26498
|
function composeTemplate(templatePath, targetDir, options) {
|
|
26499
26499
|
const filesDir = join2(templatePath, "files");
|
|
26500
26500
|
copySync(filesDir, targetDir);
|
|
26501
|
-
const
|
|
26501
|
+
const envExamplePath = join2(targetDir, ".env.example");
|
|
26502
|
+
const envPath = join2(targetDir, ".env");
|
|
26503
|
+
if (existsSync2(envExamplePath) && !existsSync2(envPath)) {
|
|
26504
|
+
copySync(envExamplePath, envPath);
|
|
26505
|
+
}
|
|
26506
|
+
const entryFiles = ts(join2(targetDir, "**/*.{ts,js,json,tsx,html,md,env,env.example}"));
|
|
26502
26507
|
entryFiles.forEach((file) => {
|
|
26503
26508
|
let content = readFileSync2(file, "utf8");
|
|
26504
26509
|
content = content.replace(/{{PROJECT_NAME}}/g, options.projectName);
|