From 4c969a6ae7666fbcbd8effe91077f6356b05321c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 23 Sep 2015 18:15:28 +0000 Subject: [PATCH] fix sudo wrapper --- lib/vagrant-lxc/sudo_wrapper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/sudo_wrapper.rb b/lib/vagrant-lxc/sudo_wrapper.rb index f344d9f..798435e 100644 --- a/lib/vagrant-lxc/sudo_wrapper.rb +++ b/lib/vagrant-lxc/sudo_wrapper.rb @@ -13,8 +13,12 @@ module Vagrant def run(*command) options = command.last.is_a?(Hash) ? command.last : {} - command.unshift @wrapper_path if @wrapper_path && !options[:no_wrapper] - execute *(['sudo', '/usr/bin/env'] + command) + if @wrapper_path && !options[:no_wrapper] + command.unshift @wrapper_path + execute *(['sudo'] + command) + else + execute *(['sudo', '/usr/bin/env'] + command) + end end private