mirror of
https://github.com/cmderdev/cmder.git
synced 2025-11-09 21:59:08 +08:00
Add fallback to detect CMDER_ROOT from script location
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
6
vendor/cmder.sh
vendored
6
vendor/cmder.sh
vendored
@@ -30,9 +30,15 @@ run_profile_d() {
|
||||
# Converts Windows paths to Unix paths if needed
|
||||
# ConEmuDir is set by ConEmu/Cmder environment
|
||||
if [ -z "$CMDER_ROOT" ]; then
|
||||
# Try to get CMDER_ROOT from ConEmuDir
|
||||
case "$ConEmuDir" in
|
||||
*\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." && pwd );;
|
||||
esac
|
||||
|
||||
# If still not set, derive from script location (vendor -> root)
|
||||
if [ -z "$CMDER_ROOT" ]; then
|
||||
CMDER_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||
fi
|
||||
else
|
||||
case "$CMDER_ROOT" in
|
||||
*\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";;
|
||||
|
||||
Reference in New Issue
Block a user