mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Fixed profile.d support for bash
This commit is contained in:
parent
a959409c0f
commit
361a8eae66
27
vendor/cmder.sh
vendored
27
vendor/cmder.sh
vendored
@ -35,18 +35,25 @@ PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT}
|
|||||||
|
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
# Drop *.sh files into "%CMDER_ROOT%\config\profile.d"
|
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
|
||||||
# to run 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
|
||||||
|
|
||||||
pushd ${CMDER_ROOT}/config/profile.d >/dev/null
|
if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
|
||||||
for x in $(ls ${CMDER_ROOT}/config/profile.d/*.sh) ; do
|
unset profile_d_scripts
|
||||||
# echo ${x}
|
pushd ${CMDER_ROOT}/config/profile.d >/dev/null
|
||||||
. $x
|
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh) 2>/dev/null
|
||||||
done
|
|
||||||
popd >/dev/null
|
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
||||||
|
for x in ${profile_d_scripts} ; do
|
||||||
|
# echo Sourcing "${x}"...
|
||||||
|
. $x
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
popd >/dev/null
|
||||||
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user