diff --git a/Jakefile b/Jakefile index 37556e7d8..21604f47d 100644 --- a/Jakefile +++ b/Jakefile @@ -57,7 +57,11 @@ task ("sudo-install", ["CommonJS"], function() // FIXME: require("narwhal/tusk/install").install({}, $COMMONJS); // Doesn't work due to some weird this.print business. if (OS.system(["sudo", "tusk", "install", "--force", $BUILD_CJS_OBJECTIVE_J, $BUILD_CJS_CAPPUCCINO])) - OS.exit(1); //rake abort if ($? != 0) + { + // Attempt a hackish work-around for sudo compiled with the --with-secure-path option + if (OS.system("sudo bash -c 'source `sh shell_config_file.sh`; tusk install --force " + $BUILD_CJS_OBJECTIVE_J + " " + $BUILD_CJS_CAPPUCCINO + "'")) + OS.exit(1); //rake abort if ($? != 0) + } }); // Documentation diff --git a/bootstrap.sh b/bootstrap.sh index be6478f27..8dfe33661 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -35,17 +35,7 @@ function ask_remove_dir () { function ask_append_shell_config () { config_string="$1" - shell_config_file="" - # use order outlined by http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup - if [ -f "$HOME/.bash_profile" ]; then - shell_config_file="$HOME/.bash_profile" - elif [ -f "$HOME/.bash_login" ]; then - shell_config_file="$HOME/.bash_login" - elif [ -f "$HOME/.profile" ]; then - shell_config_file="$HOME/.profile" - elif [ -f "$HOME/.bashrc" ]; then - shell_config_file="$HOME/.bashrc" - fi + shell_config_file=`sh shell_config_file.sh` echo " \"$config_string\" will be appended to \"$shell_config_file\"." if prompt; then diff --git a/shell_config_file.sh b/shell_config_file.sh new file mode 100755 index 000000000..c52e8bc17 --- /dev/null +++ b/shell_config_file.sh @@ -0,0 +1,13 @@ +shell_config_file="" +# use order outlined by http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup +if [ -f "$HOME/.bash_profile" ]; then + shell_config_file="$HOME/.bash_profile" +elif [ -f "$HOME/.bash_login" ]; then + shell_config_file="$HOME/.bash_login" +elif [ -f "$HOME/.profile" ]; then + shell_config_file="$HOME/.profile" +elif [ -f "$HOME/.bashrc" ]; then + shell_config_file="$HOME/.bashrc" +fi + +echo $shell_config_file