Fix CMDER_ROOT validation and optimize cmder.sh/cmder_exinit #3044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed critical path errors when
$CMDER_ROOTis unset and silentcpfailures when default template is missing. Optimized both shell scripts with proper validation, documentation, and bash-idiomatic conventions. Added automatic CMDER_ROOT detection from script location for CI environments.Core Fixes
/config/user_profile.shuser_profile.sh.defaultwhen it exists, preventing silent cp failurescmder_user_profile_pathassignment until after CMDER_ROOT validationCMDER_ROOT Detection Hierarchy
Scripts now use a three-tier detection approach:
$CMDER_ROOTenvironment variable$ConEmuDir(when running in ConEmu/Cmder)${BASH_SOURCE[0]}(vendor directory → parent = root)This ensures scripts work in CI environments (like GitHub Actions) without requiring explicit CMDER_ROOT configuration in
.ymlfiles.Code Quality
run_profile_d()and major sectionsrunProfiled→run_profile_d,CmderUserProfilePath→cmder_user_profile_pathsedinvocation with bash parameter expansion (${CMDER_ROOT%/})Why tests.yml Doesn't Fail on cp Errors
Bash continues after command failures without
set -e. Exit code reflects the last command (a successfulifstatement), not intermediate failures. Our validation prevents the error condition entirely.Files changed:
vendor/cmder.sh: 100 → 136 linesvendor/cmder_exinit: 114 → 153 linesOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.