Add fallback to detect CMDER_ROOT from script location

Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-09 01:39:20 +00:00
parent 49b7eee23a
commit b254bad5de
2 changed files with 21 additions and 0 deletions

6
vendor/cmder.sh vendored
View File

@@ -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")";;