update profile.ps1's debug output

This commit is contained in:
David Refoua
2025-11-09 04:36:41 +03:30
parent dc3b142b32
commit 7f0cfac498
2 changed files with 7 additions and 5 deletions

View File

@@ -48,8 +48,7 @@ jobs:
cmd /c vendor\init.bat /v /d /t cmd /c vendor\init.bat /v /d /t
- name: Testing PowerShell - name: Testing PowerShell
run: | run: |
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$CMDER_DEBUG = 1; 'vendor\profile.ps1' 4>&1 5>&1" PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'"
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'" 4>&1 5>&1
- name: Testing Bash - name: Testing Bash
run: | run: |
bash vendor/cmder.sh bash vendor/cmder.sh

9
vendor/profile.ps1 vendored
View File

@@ -45,7 +45,7 @@ if (-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderMo
$env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;") $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
} }
if ($ENV:CMDER_USER_CONFIG) { if ($env:CMDER_USER_CONFIG) {
Write-Verbose "CMDER IS ALSO USING INDIVIDUAL USER CONFIG FROM '$ENV:CMDER_USER_CONFIG'!" Write-Verbose "CMDER IS ALSO USING INDIVIDUAL USER CONFIG FROM '$ENV:CMDER_USER_CONFIG'!"
} }
@@ -71,11 +71,14 @@ foreach ($git in (Get-Command -ErrorAction SilentlyContinue 'git')) {
# Use user installed Git # Use user installed Git
if ($null -eq $gitPathUser) { if ($null -eq $gitPathUser) {
Write-Debug "Detected Git from mingw bin directory"
Write-Debug "Git Dir: ${gitDir}"
if ($gitDir -match '\\mingw32\\bin' -or $gitDir -match '\\mingw64\\bin') { if ($gitDir -match '\\mingw32\\bin' -or $gitDir -match '\\mingw64\\bin') {
$gitPathUser = ($gitDir.subString(0,$gitDir.Length - 12)) $gitPathUser = $gitDir.subString(0, $gitDir.Length - 12)
} else { } else {
$gitPathUser = ($gitDir.subString(0,$gitDir.Length - 4)) $gitPathUser = $gitDir.subString(0, $gitDir.Length - 4)
} }
Write-Debug "Git Path User: ${gitDir}"
} }
if ($useGitVersion -eq $gitVersionUser) { if ($useGitVersion -eq $gitVersionUser) {