8000 Skip error when running `bin/rake local` by deivid-rodriguez · Pull Request #5789 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Skip error when running bin/rake local #5789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions tasks/local.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ task :local do
# Discard the "local" argument (name of the task)
argv = ARGV[1..-1]

# If it's a rails command, auto add the rails script
if %w(generate console server dbconsole g c s runner).include?(argv[0]) || argv[0] =~ /db:/
argv.unshift('rails')
end
if argv.any?
# If it's a rails command, auto add the rails script
if %w(generate console server dbconsole g c s runner).include?(argv[0]) || argv[0] =~ /db:/
argv.unshift('rails')
end

command = ['bundle', 'exec', *argv].join(' ')
gemfile = ENV['BUNDLE_GEMFILE'] || File.expand_path("../Gemfile", __dir__)
env = { 'BUNDLE_GEMFILE' => gemfile }
command = ['bundle', 'exec', *argv].join(' ')
gemfile = ENV['BUNDLE_GEMFILE'] || File.expand_path("../Gemfile", __dir__)
env = { 'BUNDLE_GEMFILE' => gemfile }

Dir.chdir(app_folder) do
Bundler.with_original_env { Kernel.exec(env, command) }
Dir.chdir(app_folder) do
Bundler.with_original_env { Kernel.exec(env, command) }
end
end
end
0