Skip to content

Commit ef4bdac

Browse files
committed
fix: ensure dbc.exe is cached and sidecar write is guarded on Windows
- Add ~/.local/bin/dbc.exe to cache path so Windows binary is restored on cache hit - Guard empty $installDir in cache-hit PATH step with Write-Error diagnostic - Move sidecar write in install-windows.ps1 to after dbc --version succeeds so only a verified install location is recorded
1 parent 96919b1 commit ef4bdac

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ runs:
5252
# Missing paths are silently ignored by the cache action
5353
path: |
5454
~/.local/bin/dbc
55+
~/.local/bin/dbc.exe
5556
~/.local/bin/dbc-install-dir.txt
5657
~/Library/Application Support/dbc
5758
${{ runner.temp }}/dbc
@@ -86,7 +87,11 @@ runs:
8687
} else {
8788
$installDir = Join-Path $env:USERPROFILE ".local\bin"
8889
}
89-
$installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
90+
if ($installDir) {
91+
$installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
92+
} else {
93+
Write-Error "dbc-install-dir.txt is empty; cannot add dbc to PATH"
94+
}
9095
9196
- name: Get installed version
9297
id: install

install-windows.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ try {
6363
$actualDbcDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
6464
}
6565

66+
# Output version for verification
67+
dbc --version
68+
6669
# Save actual install path so cache-hit runs use the verified location.
70+
# Written after dbc --version succeeds to guarantee it records a working install.
6771
# Always written to ~\.local\bin\dbc-install-dir.txt regardless of $actualDbcDir,
6872
# consistent with the cache-restore step that reads from that fixed path.
6973
# Guarded by $env:GITHUB_PATH to skip during local debugging outside GitHub Actions.
@@ -72,9 +76,6 @@ try {
7276
$actualDbcDir | Out-File -FilePath (Join-Path $env:USERPROFILE ".local\bin\dbc-install-dir.txt") -Encoding utf8
7377
}
7478

75-
# Output version for verification
76-
dbc --version
77-
7879
Write-Host "dbc CLI installed successfully"
7980
}
8081
catch {

0 commit comments

Comments
 (0)