Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 9dd1bf0

Browse files
committed
Add ability to globally set module options through environment vars
1 parent ecad3c1 commit 9dd1bf0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

wpxf.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,14 @@
7878
end
7979
end
8080

81+
found_env_var = false
82+
ENV.each do |name, value|
83+
match = name.match(/^wpxf_(.+)/i)
84+
if match
85+
console.gset match.captures[0], value
86+
found_env_var = true
87+
end
88+
end
89+
90+
puts if found_env_var
8191
console.start

0 commit comments

Comments
 (0)