Ensure no new line chars in envs

This commit is contained in:
Ethan Dennis
2023-05-15 15:39:52 -07:00
parent b0e1adc47c
commit 15f467cdf1
2 changed files with 14 additions and 0 deletions
+2
View File
@@ -14,6 +14,8 @@ module EnvironmentWriter
def modify_env(file, name, value)
return if value.nil?
raise ArgumentError, "Invalid input: #{name}=#{value}" if value.include?("\n")
File.open(ENV[file], "a") do |f|
f.puts "#{name}=#{value}"
end