Skip to content

Commit

Permalink
fix: ignore files which dons't contain placholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest committed Feb 27, 2022
1 parent 38bc59e commit 077ce8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ export const main = (di: {
}
if (outputFileName.endsWith(backupFileExt)) return;

const code = readFileSync(outputFileName, "utf8");
if (code.includes(placeholder) === false) return;
copyFileSync(outputFileName, backupFileName);

const code = readFileSync(outputFileName, "utf8");
const outputCode = code.replace(placeholder, JSON.stringify(env));
writeFileSync(outputFileName, outputCode);
});
Expand Down

0 comments on commit 077ce8d

Please sign in to comment.