Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function copyTemplate(fromPath, toPath, data, ejsOptions = {}) {
const fileContent = readFileFromPath(fromPath);
if (fileContent) {
const processed = processTemplate(fileContent, data, ejsOptions);
writeFileToPath(toPath, processed);
writeFileToPath(toPath.replace(/\.ejs/g, ''), processed);
}
}

Expand All @@ -379,7 +379,7 @@ export function copyTemplates(fromGlob, toDir = process.cwd(), data = {}, ejsOpt

// find path write to (force / also on windows)
const replace = path.join(fromGlob.replace(/\*/g, '')).replace(/\\(?! )/g, '/');
const toPath = filePath.replace(replace, `${toDir}/`);
const toPath = filePath.replace(replace, `${toDir}/`).replace(/\.ejs/g, '');

copiedFiles.push({ toPath, processed });
writeFileToPath(toPath, processed);
Expand Down Expand Up @@ -468,7 +468,7 @@ export function copyTemplateJsonInto(
finalObj = temp;
}

writeFileToPath(toPath, JSON.stringify(finalObj, null, 2));
writeFileToPath(toPath.replace(/\.ejs/g, ''), JSON.stringify(finalObj, null, 2));
}

/**
Expand Down