-
Couldn't load subscription status.
- Fork 152
Fix just clean command for Windows PowerShell compatibility and missing directory handling
#730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
just clean command for Windows PowerShell compatibility and missing directory handling
|
@simongdavies is this really the simplest way to do this on pwsh? |
No, @copilot please use |
Updated to use |
|
@copilot , its not possible to use '-ErrorAction SilentlyContinue |
Removed |
|
@copilot instead of using if (Test-Path src/tests/rust_guests/witguest) use -ErrorAction SilentlyContinue on the cd src/tests/rust_guests/witguest, but do not change cargo clean as |
Updated to use |
6c28cf0 to
67f83f1
Compare
…y handling Co-authored-by: simongdavies <[email protected]> Signed-off-by: Simon Davies <[email protected]>
67f83f1 to
1bd0a79
Compare
The
just cleancommand was failing on Windows due to two issues:PowerShell compatibility: The command
rm -f interface.wasmis ambiguous in PowerShell on Windows, causing the clean operation to fail.Missing directory handling: The command would fail if the
src/tests/rust_guests/witguestdirectory didn't exist, which could happen in certain build scenarios or incomplete checkouts.Changes Made
This PR fixes both issues by implementing cross-platform conditional logic in the
clean-rusttarget:Before:
After:
Platform-Specific Solutions
ErrorAction SilentlyContinueto ignore errors andRemove-Itemto delete files[ -d ... ]andrm -fwith proper error handlingTesting
The fix has been tested for the following scenarios:
interface.wasmfile doesn't existwitguestdirectory doesn't existFixes #729.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.