19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/greenhouse/commands/console.rb', line 19
def run
if arguments.empty? || arguments.all? { |arg| valid_arguments.map(&:keys).flatten.include?(arg) }
puts "An application is required."
puts
print " "
usage
return
end
app = Projects::applications.select { |application| arguments.map(&:key).include?(application.name) }.first
if app.nil?
puts "Application does not exist. Try adding it with `#{::Greenhouse::CLI::binary} add` and initializing it with `#{::Greenhouse::CLI::binary} init`"
return
end
Bundler.with_clean_env do
app.chdir do
exec 'bundle exec rails console'
end
end
end
|