mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-16 06:37:54 +08:00
## Rename user-profile.* user_profile.* to resolve #1806, #1675 * This is a backward compatible fix and will automatically and silently rename users '%cmder_root%/config/user-profile.\*' to '%cmder_root%/config/user_profile.\*' and '[user_specified_config_root]/user-profile.\*' to '[user_specified_config_root]/user_profile.\*' if the sources exist. * Cmder.exe does this for cmd.exe sessions. * The init scripts for bash and Powershell handles it for these shells
This commit is contained in:
committed by
Benjamin Staneck
parent
e4fb0d694b
commit
49da3745bc
31
vendor/cmder.sh
vendored
31
vendor/cmder.sh
vendored
@ -1,6 +1,6 @@
|
||||
# DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE
|
||||
#
|
||||
# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh,
|
||||
# Add portable user customizations ${CMDER_ROOT}/config/user_profile.sh,
|
||||
# these customizations will follow Cmder if $CMDER_ROOT is copied
|
||||
# to another machine.
|
||||
#
|
||||
@ -63,21 +63,32 @@ if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then
|
||||
runProfiled "${CMDER_USER_CONFIG}/profile.d"
|
||||
fi
|
||||
|
||||
initialConfig="${CMDER_ROOT}/config/user-profile.sh"
|
||||
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
|
||||
. "${CMDER_ROOT}/config/user-profile.sh"
|
||||
|
||||
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||
if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then
|
||||
mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh"
|
||||
fi
|
||||
|
||||
CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh"
|
||||
if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then
|
||||
. "${CMDER_ROOT}/config/user_profile.sh"
|
||||
fi
|
||||
|
||||
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
|
||||
initialConfig="${CMDER_USER_CONFIG}/user-profile.sh"
|
||||
if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then
|
||||
. "${CMDER_USER_CONFIG}/user-profile.sh"
|
||||
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
|
||||
if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then
|
||||
mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh"
|
||||
fi
|
||||
|
||||
CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh"
|
||||
if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then
|
||||
. "${CMDER_USER_CONFIG}/user_profile.sh"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "${initialConfig}" ] ; then
|
||||
echo Creating user startup file: "${initialConfig}"
|
||||
cat <<-eof >"${initialConfig}"
|
||||
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
||||
echo Creating user startup file: "${CmderUserProfilePath}"
|
||||
cat <<-eof >"${CmderUserProfilePath}"
|
||||
# use this file to run your own startup commands for msys2 bash'
|
||||
|
||||
# To add a new vendor to the path, do something like:
|
||||
|
Reference in New Issue
Block a user