Skip to content

Commit

Permalink
fix(runScript): regex for rewriting env
Browse files Browse the repository at this point in the history
  • Loading branch information
shoma-mano committed Nov 10, 2024
1 parent a0fba95 commit 7c3ce2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const runScript = (path: string | (() => void), funcName?: string) => {
});

let code = outputFiles[0].text;
code = code.replace(/\${process\.env\.([^\n\s]*)}/g, (_, p1) => {
code = code.replace(/(?:\${)?process\.env\.([^\n\s}]*)}?/g, (_, p1) => {
return process.env[p1] || "";
});
code = deleteExport(code);
Expand Down

0 comments on commit 7c3ce2f

Please sign in to comment.