From 361a8eae66fb74ade18c403c9fe4885bee1eee77 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 27 Feb 2016 12:19:03 -0600 Subject: [PATCH] Fixed profile.d support for bash --- vendor/cmder.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index f51ace3..2666f58 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -35,18 +35,25 @@ PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} export PATH -# Drop *.sh files into "%CMDER_ROOT%\config\profile.d" -# to run them at startup. -if [ ! -d ${CMDER_ROOT}/config/profile.d ] ; then - mkdir -p "${CMDER_ROOT}/config/profile.d" +# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d" +# to source them at startup. +if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then + mkdir -p ${CMDER_ROOT}/config/profile.d fi -pushd ${CMDER_ROOT}/config/profile.d >/dev/null -for x in $(ls ${CMDER_ROOT}/config/profile.d/*.sh) ; do - # echo ${x} - . $x -done -popd >/dev/null +if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then + unset profile_d_scripts + pushd ${CMDER_ROOT}/config/profile.d >/dev/null + profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh) 2>/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 . ${CMDER_ROOT}/config/user-profile.sh