chore: fix windows specific script errors #5051
Merged
+7
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR aims to solve the errors thrown by
just l
andjust _touch
on Windows systems.just l
The linter succeeds in CI but not locally on my Windows machine. This is because it seems to not lint code with the
#[cfg(target_os = "windows")]
directive as the runner OS is Linux. In the future I suggest using a matrix runner in CI that runs the same linter workflow on both Windows and Unix so every OS is covered.These were the fixes I had to implement on my local Windows machine, as recommend by the linter:
&
)#[cfg(not(windows))]
to Linux only variables, avoiding unused variable errorsjust _touch
Made the script call
powershell
explicitly, this allows the user to use either CMD, Powershell, or any other shell of their choice on Windows and still have the command called by Powershell under the hood.Fixes other scripts by extension, like
test-lintrule
andtest-transform
, that relied onjust _touch
to function correctly.Test Plan
Changes made do not require tests.