From 79f8560a24af9fae74f9c1fc594397db1bfe1b3f Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 27 Feb 2016 07:40:47 -0600 Subject: [PATCH] added profile.d stuff --- vendor/cmder_exinit | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/vendor/cmder_exinit b/vendor/cmder_exinit index e924684..d4a0147 100644 --- a/vendor/cmder_exinit +++ b/vendor/cmder_exinit @@ -1,7 +1,8 @@ -# Copy this file to your externally installed meaning not in the cmder/vendor -# folder Cygwin/Msys2/Msys installs '/etc/profile.d/' folder to integrate -# the externally installed Unix like environment into Cmder so it has -# access to settings stored in Cmder/config folder when launched. +# Copy this file to your non integrated *nix-like environment, +# Cygwin/MinGW/MSys2/Git for Windows SDK, installs '/etc/profile.d/' +# folder to integrate the externally installed Unix like environment +# into Cmder so it has access to settings stored in Cmder/config +# folder when launched. # # The destination file extension depends on the shell you use. For example: # @@ -12,8 +13,11 @@ # # from outside Cmder. # CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder. -# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh, -# these customizations will follow Cmder if $CMDER_ROOT is copied +# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh or +# add whole config scripts to ${CMDER_ROOT}/config/profile.d both will be sourced +# from mthis file and be appied to the environment at startup. +# +# These customizations will follow Cmder if $CMDER_ROOT is copied # to another machine. # # Add system specific users customizations to $HOME/.bashrc, these @@ -46,6 +50,21 @@ PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} export PATH +if [ ! -d ${CMDER_ROOT}/config/profile.d ; then + mkdir -p ${CMDER_ROOT}/config/profile.d +fi + +# Drop *.sh files into "${CMDER_ROOT}\config\profile.d" +# to source them at startup. +if [ -d ${CMDER_ROOT}/config/profile.d ] ; then + 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 +fi + if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then . ${CMDER_ROOT}/config/user-profile.sh else