Skip to content
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

Allowing direct execution of the bundler if already in the shell #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions lib/bundix/commandline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ def handle_magic
ENV['BUNDLE_GEMFILE'] = options[:gemfile]

if options[:magic]
fail unless system(
Bundix::NIX_SHELL, '-p', options[:ruby],
"bundler.override { ruby = #{options[:ruby]}; }",
"--command", "bundle lock --lockfile=#{options[:lockfile]}")
fail unless system(
Bundix::NIX_SHELL, '-p', options[:ruby],
"bundler.override { ruby = #{options[:ruby]}; }",
"--command", "bundle pack --all --path #{options[:bundle_pack_path]}")
prefix =
if ENV['IN_NIX_SHELL']
[]
else
[Bundix::NIX_SHELL, '-p', options[:ruby], "bundler.override { ruby = #{options[:ruby]}; }", "--command"]
end
fail unless system(*prefix, "bundle lock --lockfile=#{options[:lockfile]}")
fail unless system(*prefix, "bundle pack --path #{options[:bundle_pack_path]}")
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundix/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def download(file, url)
end

begin
open(uri.to_s, 'r', 0600, open_options) do |net|
URI.open(uri.to_s, 'r', 0600, open_options) do |net|
File.open(file, 'wb+') { |local|
File.copy_stream(net, local)
}
Expand Down