parent
ad00b74f4c
commit
f29a195f49
|
|
@ -5,6 +5,16 @@ BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN=${BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN:-250
|
|||
BASH_IT_LOAD_PRIORITY_DEFAULT_COMPLETION=${BASH_IT_LOAD_PRIORITY_DEFAULT_COMPLETION:-350}
|
||||
BASH_IT_LOAD_PRIORITY_SEPARATOR="---"
|
||||
|
||||
# Handle the different ways of running `sed` without generating a backup file based on OS
|
||||
# - GNU sed (Linux) uses `-i`
|
||||
# - BSD sed (macOS) uses `-i ''`
|
||||
# To use this in Bash-it for inline replacements with `sed`, use the following syntax:
|
||||
# sed "${BASH_IT_SED_I_PARAMETERS[@]}" -e "..." file
|
||||
BASH_IT_SED_I_PARAMETERS=(-i)
|
||||
case "$(uname)" in
|
||||
Darwin*) BASH_IT_SED_I_PARAMETERS=(-i "")
|
||||
esac
|
||||
|
||||
function _command_exists ()
|
||||
{
|
||||
_about 'checks for existence of a command'
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ ssh-disable-proxy ()
|
|||
group 'proxy'
|
||||
|
||||
if [ -f ~/.ssh/config ] ; then
|
||||
sed -e's/^.*ProxyCommand/# ProxyCommand/' -i "" ~/.ssh/config
|
||||
sed -e's/^.*ProxyCommand/# ProxyCommand/' "${BASH_IT_SED_I_PARAMETERS[@]}" ~/.ssh/config
|
||||
echo "Disabled SSH config proxy settings"
|
||||
fi
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ ssh-enable-proxy ()
|
|||
group 'proxy'
|
||||
|
||||
if [ -f ~/.ssh/config ] ; then
|
||||
sed -e's/# ProxyCommand/ ProxyCommand/' -i "" ~/.ssh/config
|
||||
sed -e's/# ProxyCommand/ ProxyCommand/' "${BASH_IT_SED_I_PARAMETERS[@]}" ~/.ssh/config
|
||||
echo "Enabled SSH config proxy settings"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue