Skip to content

Commit

Permalink
fix: do not remove file extension from hygen templates when copied by…
Browse files Browse the repository at this point in the history
… dev server
  • Loading branch information
kgajera committed Jul 2, 2021
1 parent 187b1aa commit 663589e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/create-bison-app/scripts/createDevAppAndStartServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ async function init() {
));

const copyFile = async (src) => {
const relativeSrc = cleanTemplateDestPath(src.replace(templateFolder, ""));
const dest = path.join(devAppPath, relativeSrc);
if (src.match(/\.ejs$/) && !src.match(/_templates\//)) {
const relativeSrc = src.replace(templateFolder, "");
const isHygenTemplate = src.match(/_templates\//);
const dest = path.join(
devAppPath,
isHygenTemplate ? relativeSrc : cleanTemplateDestPath(relativeSrc)
);
if (src.match(/\.ejs$/) && !isHygenTemplate) {
await copyWithTemplate(src, dest, templateVariables);
} else {
await fs.promises.copyFile(src, dest);
Expand Down

0 comments on commit 663589e

Please sign in to comment.