Don't spawn subshells, use exec

This commit is contained in:
Martin Schürrer 2015-10-01 19:31:53 +02:00
parent 78d516d063
commit aaa8abfd23
2 changed files with 11 additions and 16 deletions

View File

@ -48,22 +48,17 @@ fi
if [ -f ${plugin_path}/bin/exec-env ]; then if [ -f ${plugin_path}/bin/exec-env ]; then
( export ASDF_INSTALL_TYPE=$install_type
export ASDF_INSTALL_TYPE=$install_type export ASDF_INSTALL_VERSION=$version
export ASDF_INSTALL_VERSION=$version export ASDF_INSTALL_PATH=$install_path
export ASDF_INSTALL_PATH=$install_path
source ${plugin_path}/bin/exec-env source ${plugin_path}/bin/exec-env
# unset everything, we don't want to pollute # unset everything, we don't want to pollute
unset ASDF_INSTALL_TYPE unset ASDF_INSTALL_TYPE
unset ASDF_INSTALL_VERSION unset ASDF_INSTALL_VERSION
unset ASDF_INSTALL_PATH unset ASDF_INSTALL_PATH
exec ${install_path}/${executable_path} "${@:3}"
${install_path}/${executable_path} "${@:3}"
)
else else
( exec ${install_path}/${executable_path} "${@:3}"
${install_path}/${executable_path} "${@:3}"
)
fi fi

View File

@ -49,7 +49,7 @@ write_shim_script() {
cp $plugin_shims_path/$executable_name $shim_path cp $plugin_shims_path/$executable_name $shim_path
else else
echo """#!/usr/bin/env bash echo """#!/usr/bin/env bash
$(asdf_dir)/bin/private/asdf-exec ${plugin_name} ${executable_path} \"\$@\" exec $(asdf_dir)/bin/private/asdf-exec ${plugin_name} ${executable_path} \"\$@\"
""" > $shim_path """ > $shim_path
fi fi