File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,31 @@ jobs:
3131 with :
3232 node-version : 20
3333
34- - name : Remove globally installed Yarn
34+ - name : Remove Yarn on Windows
35+ if : runner.os == 'Windows'
36+ shell : powershell
3537 run : |
36- rm -force /usr/local/bin/yarn /usr/local/bin/yarnpkg
37- rm -force /Users/runner/.yarn/bin/yarn /Users/runner/.yarn/bin/yarnpkg
38+ $paths = @(
39+ "$env:USERPROFILE\.yarn\bin\yarn.cmd",
40+ "$env:USERPROFILE\.yarn\bin\yarnpkg.cmd",
41+ "C:\Program Files (x86)\Yarn\bin\yarn.cmd",
42+ "C:\Program Files (x86)\Yarn\bin\yarnpkg.cmd",
43+ "C:\Program Files\Yarn\bin\yarn.cmd",
44+ "C:\Program Files\Yarn\bin\yarnpkg.cmd"
45+ )
46+ foreach ($path in $paths) {
47+ if (Test-Path $path) {
48+ Remove-Item $path -Force
49+ }
50+ }
51+ where yarn || echo "✅ Yarn not found"
52+
53+
54+ - name : Remove Yarn on Linux/macOS
55+ if : runner.os != 'Windows'
56+ run : |
57+ rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
58+ rm -f /Users/runner/.yarn/bin/yarn /Users/runner/.yarn/bin/yarnpkg
3859 echo "🧹 Yarn removed"
3960
4061 - name : Check for yarn
You can’t perform that action at this time.
0 commit comments