Merge pull request #1078 from orionlee/fix_bash_login_when_cmder_root_has_spaces

Fix bash login when $CMDER_ROOT has spaces
This commit is contained in:
Benjamin Staneck 2016-08-21 20:23:20 +02:00 committed by GitHub
commit 355df7a48a
2 changed files with 15 additions and 15 deletions

14
vendor/cmder.sh vendored
View File

@ -38,25 +38,25 @@ export PATH
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d" # Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
# to source them at startup. # to source them at startup.
if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then
mkdir -p ${CMDER_ROOT}/config/profile.d mkdir -p "${CMDER_ROOT}/config/profile.d"
fi fi
if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
unset profile_d_scripts unset profile_d_scripts
pushd ${CMDER_ROOT}/config/profile.d >/dev/null pushd "${CMDER_ROOT}/config/profile.d" >/dev/null
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh 2>/dev/null) profile_d_scripts=$(ls *.sh 2>/dev/null)
if [ ! "x${profile_d_scripts}" = "x" ] ; then if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do for x in ${profile_d_scripts} ; do
# echo Sourcing "${x}"... # echo Sourcing "${CMDER_ROOT}/config/profile.d/${x}"...
. $x . "${CMDER_ROOT}/config/profile.d/${x}"
done done
fi fi
popd >/dev/null popd >/dev/null
fi fi
if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. ${CMDER_ROOT}/config/user-profile.sh . "${CMDER_ROOT}/config/user-profile.sh"
else else
echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh" echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh"
cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh" cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh"

16
vendor/cmder_exinit vendored
View File

@ -51,29 +51,29 @@ if [ ! "$CMDER_ROOT" = "" ] ; then
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d" # Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
# to source them at startup. # to source them at startup.
if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then
mkdir -p ${CMDER_ROOT}/config/profile.d mkdir -p "${CMDER_ROOT}/config/profile.d"
fi fi
if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
unset profile_d_scripts unset profile_d_scripts
pushd ${CMDER_ROOT}/config/profile.d >/dev/null pushd "${CMDER_ROOT}/config/profile.d" >/dev/null
if [ ! "x${ZSH_VERSION}" = "x" ]; then if [ ! "x${ZSH_VERSION}" = "x" ]; then
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.zsh 2>/dev/null) profile_d_scripts=$(ls *.zsh 2>/dev/null)
elif [ ! "x${BASH_VERSION}" = "x" ]; then elif [ ! "x${BASH_VERSION}" = "x" ]; then
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh 2>/dev/null) profile_d_scripts=$(ls *.sh 2>/dev/null)
fi fi
if [ ! "x${profile_d_scripts}" = "x" ] ; then if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do for x in ${profile_d_scripts} ; do
# echo Sourcing "${x}"... # echo Sourcing "${CMDER_ROOT}/config/profile.d/${x}"...
. $x . "${CMDER_ROOT}/config/profile.d/${x}"
done done
fi fi
popd >/dev/null popd >/dev/null
fi fi
if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. ${CMDER_ROOT}/config/user-profile.sh . "${CMDER_ROOT}/config/user-profile.sh"
else else
echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh" echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh"
cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh" cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh"