Fix just clean command for Windows PowerShell compatibility and missing directory handling#730
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 <1397489+simongdavies@users.noreply.github.com> Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
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.