Skip to content

Commit

Permalink
Add null case to Sys.putEnv() (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk authored Oct 20, 2021
1 parent 854a0cf commit 5e6ca1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Sys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ class Sys {
return process.env[s];
}

public static inline function putEnv(s:String, v:String):Void {
process.env[s] = v;
public static inline function putEnv(s:String, v:Null<String>):Void {
if (v == null)
process.env.remove(s);
else
process.env[s] = v;
}

public static function environment():Map<String, String> {
Expand Down

0 comments on commit 5e6ca1c

Please sign in to comment.