Skip to content

Commit 01894eb

Browse files
removed yarn based on OS
1 parent bbd6e7e commit 01894eb

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/CI.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)