mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-11 00:39:08 +08:00
Fix bash login when ${CMDER_ROOT} has spaces.
E.g., if ${CMDER_ROOT} is /c/Users/Foo Bar/cmder, the following errors will occur: bash: pushd: /c/Users/Foo: No such file or directory bash: [: /c/Users/Foo: binary operator expected bash: /c/Users/Foo: No such file or directory
This commit is contained in:
parent
393d7d19c5
commit
d095d6afd6
6
vendor/cmder.sh
vendored
6
vendor/cmder.sh
vendored
@ -43,7 +43,7 @@ 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 ${CMDER_ROOT}/config/profile.d/*.sh 2>/dev/null)
|
||||||
|
|
||||||
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
||||||
@ -55,8 +55,8 @@ if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
|
|||||||
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user