Skip to content

Commit 07e0767

Browse files
authored
Ensure binary directory exists before compile step to prevent path errors
Ensure binary directory exists before compile step to prevent path errors Extended Description: This commit adds a workflow step to `.github/workflows/compile-check.yaml` that checks for the existence of the `D:\a\winutil\winutil\binary\` directory before any compile or syntax check steps are executed. If the directory does not exist, it is created automatically. This change prevents job failures caused by missing directories when scripts attempt to enumerate or access files in the binary path. The added PowerShell step uses `Test-Path` to check for the directory and creates it using `New-Item` only if it's missing. This is especially important for clean runners and first-time builds, where the directory may not be present by default. By ensuring the directory is always available, this commit improves workflow reliability and prevents errors such as: > The job failed because it could not find the path 'D:\a\winutil\winutil\binary\'. No changes are made to the compile logic itself; only the environment setup is improved. This fix is safe, has no side effects, and is compatible with all existing steps and scripts that expect the binary directory to be present.
1 parent 0859e9c commit 07e0767

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/compile-check.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ jobs:
1515
- name: Checkout Sources
1616
uses: actions/checkout@v5
1717

18+
- name: Ensure binary directory exists
19+
run: |
20+
$filePath = 'D:\a\winutil\winutil\binary\'
21+
if (!(Test-Path "$filePath")) {
22+
New-Item -ItemType Directory -Path "$filePath"
23+
}
24+
shell: pwsh
25+
1826
- name: Compile and Syntaxcheck winutil.ps1
1927
shell: pwsh
2028
run: |

0 commit comments

Comments
 (0)