mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	--amend
This commit is contained in:
		
							
								
								
									
										85
									
								
								vendor/cmder_exinit
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										85
									
								
								vendor/cmder_exinit
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| # Copy this file to your non integrated *nix-like environment,  | # Copy this file to your non integrated *nix-like environment,  | ||||||
| # Cygwin/MinGW/MSys2/Git for Windows SDK, installs '/etc/profile.d/' | # Cygwin/MSys2/Git for Windows SDK, installs '/etc/profile.d/' | ||||||
| # folder to integrate the externally installed Unix like environment | # folder to integrate the externally installed Unix like environment | ||||||
| # into Cmder so it has access to settings stored in Cmder/config | # into Cmder so it has access to settings stored in Cmder/config | ||||||
| # folder when launched. | # folder when launched. | ||||||
| @@ -8,11 +8,6 @@ | |||||||
| # | # | ||||||
| # bash - Copy to /etc/profile.d/cmder_exinit.sh | # bash - Copy to /etc/profile.d/cmder_exinit.sh | ||||||
| # zsh  - Copy to /etc/profile.d/cmder_exinit.zsh | # zsh  - Copy to /etc/profile.d/cmder_exinit.zsh | ||||||
| # |  | ||||||
| # # Uncomment and edit the CMDER_ROOT line to use Cmder/config even when launched |  | ||||||
| # # 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 or | # 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 | # 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. | # from mthis file and be appied to the environment at startup. | ||||||
| @@ -23,65 +18,69 @@ | |||||||
| # Add system specific users customizations to $HOME/.bashrc, these  | # Add system specific users customizations to $HOME/.bashrc, these  | ||||||
| # customizations will not follow Cmder to another machine. | # customizations will not follow Cmder to another machine. | ||||||
|  |  | ||||||
|  | # # Uncomment and edit the CMDER_ROOT line to use Cmder/config even when launched | ||||||
|  | # # from outside Cmder. | ||||||
|  | # CMDER_ROOT=${USERPROFILE}/cmder  # This is not required if launched from Cmder. | ||||||
|  |  | ||||||
| # Check that we haven't already been sourced. | # Check that we haven't already been sourced. | ||||||
| [[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return | [[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return | ||||||
|  |  | ||||||
| # We do this for bash as admin sessions since $CMDER_ROOT is not being set | # We do this for bash as admin sessions since $CMDER_ROOT is not being set | ||||||
| if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then | if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then | ||||||
|   case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac |   if [ -d "${ConEmuDir}../../vendor" ] ; then | ||||||
|   if [ !-d $CMDER_ROOT/vendor ] ; then |     case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac | ||||||
|  |   else | ||||||
|     echo "Running in ConEmu without Cmder, skipping Cmder integration." |     echo "Running in ConEmu without Cmder, skipping Cmder integration." | ||||||
|     return |  | ||||||
|   fi |   fi | ||||||
| elif [ "$CMDER_ROOT" != "" ] ; then | elif [ "$CMDER_ROOT" != "" ] ; then | ||||||
|   case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac |   case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac | ||||||
| else |  | ||||||
|   return |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
| echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"...\n" | if [ ! "$CMDER_ROOT" = "" ] ; then | ||||||
|  |   # Remove any trailing '/' | ||||||
|  |   CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::') | ||||||
|    |    | ||||||
| # Remove any trailing '/' |   echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"...\n" | ||||||
| CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::') |  | ||||||
|    |    | ||||||
| export CMDER_ROOT |   export CMDER_ROOT | ||||||
|    |    | ||||||
| PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} |   PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} | ||||||
|     |     | ||||||
| export PATH |   export PATH | ||||||
|    |    | ||||||
| if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then |   # Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d" | ||||||
|   mkdir -p ${CMDER_ROOT}/config/profile.d |   # to source them at startup. | ||||||
| fi |   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 |  | ||||||
|   unset profile_d_scripts |  | ||||||
|   pushd ${CMDER_ROOT}/config/profile.d >/dev/null |  | ||||||
|   if [ ! "x${ZSH_VERSION}" = "x"  ]; then |  | ||||||
|     profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.zsh) 2>/dev/null |  | ||||||
|   elif [ ! "x${BASH_VERSION}" = "x"  ]; then |  | ||||||
|     profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh) 2>/dev/null |  | ||||||
|   fi |   fi | ||||||
|    |    | ||||||
|   if [ ! "x${profile_d_scripts}" = "x" ] ; then |   if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then | ||||||
|     for x in ${profile_d_scripts} ; do |     unset profile_d_scripts | ||||||
|       # echo Sourcing "${x}"... |     pushd ${CMDER_ROOT}/config/profile.d >/dev/null | ||||||
|       . $x |     if [ ! "x${ZSH_VERSION}" = "x"  ]; then | ||||||
|     done |       profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.zsh) 2>/dev/null | ||||||
|   fi |     elif [ ! "x${BASH_VERSION}" = "x"  ]; then | ||||||
|   popd >/dev/null |       profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh) 2>/dev/null | ||||||
| fi |     fi | ||||||
|    |    | ||||||
| if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then |     if [ ! "x${profile_d_scripts}" = "x" ] ; then | ||||||
|   . ${CMDER_ROOT}/config/user-profile.sh |       for x in ${profile_d_scripts} ; do | ||||||
| else |         # echo Sourcing "${x}"... | ||||||
|   echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh" |         . $x | ||||||
|   cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh" |       done | ||||||
|  |     fi | ||||||
|  |     popd >/dev/null | ||||||
|  |   fi | ||||||
|  |    | ||||||
|  |   if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then | ||||||
|  |     . ${CMDER_ROOT}/config/user-profile.sh | ||||||
|  |   else | ||||||
|  |     echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh" | ||||||
|  |     cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh" | ||||||
| # use this file to run your own startup commands for msys2 bash' | # use this file to run your own startup commands for msys2 bash' | ||||||
|  |  | ||||||
| # To add a new vendor to the path, do something like: | # To add a new vendor to the path, do something like: | ||||||
| # export PATH=\${CMDER_ROOT}/vendor/whatever:\${PATH} | # export PATH=\${CMDER_ROOT}/vendor/whatever:\${PATH} | ||||||
| eof | eof | ||||||
|  |   fi | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user