Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
Use /usr/bin/env CMD instead of hardcoded paths
Browse files Browse the repository at this point in the history
This fixes commands that currently rely on hardcoded paths and break
on systems like NixOS that don't have all binaries in /usr/bin etc.
  • Loading branch information
globin committed Aug 2, 2015
1 parent 9c67e13 commit 4b78c04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vagrant-lxc/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def sudo_wrapper

def ensure_lxc_installed!
begin
sudo_wrapper.run("/usr/bin/which", "lxc-create")
sudo_wrapper.run("which", "lxc-create")
rescue Vagrant::LXC::Errors::ExecuteError
raise Errors::LxcNotInstalled
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-lxc/sudo_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(wrapper_path = nil)
def run(*command)
options = command.last.is_a?(Hash) ? command.last : {}
command.unshift @wrapper_path if @wrapper_path && !options[:no_wrapper]
execute *(['sudo'] + command)
execute *(['sudo', '/usr/bin/env'] + command)
end

private
Expand Down

0 comments on commit 4b78c04

Please sign in to comment.