Ensure variables are unique

This commit is contained in:
Ethan Dennis
2023-05-17 12:57:32 -07:00
parent 15f467cdf1
commit 821f7fe05b
+5
View File
@@ -25,6 +25,7 @@ class Arguments
arguments.concat(["--custom-transformers", *@custom_transformers]) if @custom_transformers.length.positive?
rng = Random.new
variable_names = Set.new
set_output(
"args",
@@ -33,6 +34,10 @@ class Arguments
unless value.start_with?("--")
name = "variable_#{rng.rand(1000..9999)}"
name = "variable_#{rng.rand(1000..9999)}" while variable_names.include?(name)
variable_names.add(name)
set_environment(name, value)
value = "$#{name}"