7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/kitsune/kit/env_loader.rb', line 7
def self.load!
return if @loaded
env = ENV["KIT_ENV"] || read_kit_env || "development"
possible_paths = [
".kitsune/infra.#{env}.env",
".kitsune/infra.env"
]
found = possible_paths.find { |path| File.exist?(path) }
if found
Dotenv.load(found)
puts AnsiColor.colorize("๐งช Loaded Kitsune environment from #{found}", color: :light_cyan)
puts AnsiColor.colorize("=======================================================================\n", color: :light_cyan)
else
puts "โ ๏ธ No Kitsune infra config found for environment '#{env}' (looked for infra.#{env}.env and infra.env)"
end
@loaded = true
end
|