Skip to content

Commit 91ff405

Browse files
committed
Fix not unsetting things found in dev’s env
1 parent 7de8c67 commit 91ff405

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ for (const envln of env.trim().split("\n")) {
5757
if (!envln) continue;
5858

5959
const [key] = envln.split("=", 2);
60-
const value = Deno.env.get(key);
61-
62-
if (value) {
63-
undo += ` export ${key}=\\"$${key}\\"\n`;
64-
} else {
65-
undo += ` unset ${key}\n`;
66-
}
60+
undo += ` if [ \\"$${key}\\" ]; then
61+
export ${key}=\\"$${key}\\"
62+
else
63+
unset ${key}
64+
fi\n`;
6765
}
6866

6967
const dir = Deno.cwd();

0 commit comments

Comments
 (0)