Commit 9b1ffd03 authored by Gert Goet's avatar Gert Goet 🦀
Browse files

Resolve "key_alias using rails makes `envied check` barf"

Closes #10

See merge request !9
parents bc1822ce e7059988
Pipeline #71934545 passed with stage
in 1 minute and 36 seconds
......@@ -70,6 +70,9 @@ class ENVied
option :groups, type: :array, desc: "uses ENV['ENVIED_GROUPS'] as default if present", default: ENV['ENVIED_GROUPS'] || %w(default), banner: 'default production'
option :quiet, type: :boolean, desc: 'Communicate success of the check only via the exit status.'
def check
if rails_project?
require File.expand_path 'config/environment.rb'
end
ENVied.require(*options[:groups])
unless options[:quiet]
puts "All variables for group(s) #{options[:groups]} are present and valid"
......@@ -126,5 +129,11 @@ class ENVied
template("heroku-env-check.tt", full_dest)
FileUtils.chmod 0755, full_dest
end
no_tasks do
def rails_project?
File.exists?('config/environment.rb')
end
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment