add option for sync or not sync profile
Variable MYSHELLCONFIG_GIT_SYNC in ~/.bashrc if unset it defaults to true. So profile is synced If Set to false, do not sync profile
This commit is contained in:
parent
8827e99d53
commit
42e20462ca
1 changed files with 19 additions and 14 deletions
|
@ -27,6 +27,7 @@ if [[ $- = *i* ]] ; then
|
||||||
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s
|
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s
|
||||||
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
|
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
|
||||||
MYSHELLCONFIG_BASH_COMPLETION="${HOME}/${MYSHELLCONFIG_SUBPATH}/bash_completion.d"
|
MYSHELLCONFIG_BASH_COMPLETION="${HOME}/${MYSHELLCONFIG_SUBPATH}/bash_completion.d"
|
||||||
|
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && MYSHELLCONFIG_GIT_SYNC=true
|
||||||
|
|
||||||
SGIT="git -C ${MYSHELLCONFIG_BASE}"
|
SGIT="git -C ${MYSHELLCONFIG_BASE}"
|
||||||
export MYSHELLCONFIG_BASE MYSHELLCONFIG_LOGDIR MYSHELLCONFIG_LOGFILE SGIT MYSHELLCONFIG_VIM_PLUGINS
|
export MYSHELLCONFIG_BASE MYSHELLCONFIG_LOGDIR MYSHELLCONFIG_LOGFILE SGIT MYSHELLCONFIG_VIM_PLUGINS
|
||||||
|
@ -47,6 +48,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_config () {
|
sync_config () {
|
||||||
|
if $MYSHELLCONFIG_GIT_SYNC; then
|
||||||
local nok=""
|
local nok=""
|
||||||
local gco=""
|
local gco=""
|
||||||
if which git >/dev/null; then
|
if which git >/dev/null; then
|
||||||
|
@ -64,6 +66,9 @@ EOF
|
||||||
else
|
else
|
||||||
echo "git not installed, no configuration possible, please install git" >&2
|
echo "git not installed, no configuration possible, please install git" >&2
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Not syncing profile in case of configuration"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue