@@ -28,16 +28,19 @@ if isWindows; then
2828 # Install pacboy for easily installing packages
2929 pacman -S --noconfirm pactoys
3030
31- # Delete these pre-installed tools so we can't accidentally use them, because we are using the
32- # MSYS2 setup action versions instead.
33- # Delete pre-installed version of MSYS2
34- echo " Cleaning up tools in PATH"
35- rm -r " /c/msys64/"
36- # Delete Strawberry Perl, which contains a version of mingw
37- rm -r " /c/Strawberry/"
38- # Delete these other copies of mingw, I don't even know where they come from.
39- rm -r " /c/mingw64/"
40- rm -r " /c/mingw32/"
31+ # Remove these pre-installed tools so we can't accidentally use them, because we are using the
32+ # MSYS2 setup action versions instead. Because `rm -r`-ing them is slow, we mv them off path
33+ # instead.
34+ # Remove pre-installed version of MSYS2
35+ echo " Cleaning up existing tools in PATH"
36+ notpath=" /c/NOT/ON/PATH/"
37+ mkdir --parents " $notpath "
38+ mv -t " $notpath " " /c/msys64/"
39+ # Remove Strawberry Perl, which contains a version of mingw
40+ mv -t " $notpath " " /c/Strawberry/"
41+ # Remove these other copies of mingw, I don't even know where they come from.
42+ mv -t " $notpath " " /c/mingw64/"
43+ mv -t " $notpath " " /c/mingw32/"
4144 echo " Finished cleaning up tools in PATH"
4245
4346 if isKnownToBeMingwBuild; then
0 commit comments