Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 512fc8f

Browse files
committed
remove duplicate code
1 parent 2d71268 commit 512fc8f

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/ci/scripts/free-disk-space.sh

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,25 @@ AVAILABLE_INITIAL=$(getAvailableSpace)
144144
printDF "BEFORE CLEAN-UP:"
145145
echo ""
146146

147-
removeDir /usr/local/lib/android
148-
removeDir /usr/share/dotnet
149-
removeDir /usr/share/swift
150-
removeDir "$AGENT_TOOLSDIRECTORY"
151-
removeDir /usr/local/share/powershell
152-
removeDir /usr/local/share/chromium
153-
removeDir /usr/local/lib/node_modules
154-
removeDir /usr/share/miniconda/
155-
removeDir /usr/share/icons/
156-
removeDir "/usr/share/az_*"
157-
removeDir /usr/lib/heroku/
158-
159-
# Haskell runtime
160-
removeDir /opt/ghc
161-
removeDir /usr/local/.ghcup
147+
dirs_to_remove=(
148+
"/usr/local/lib/android"
149+
"/usr/share/dotnet"
150+
"/usr/share/swift"
151+
"$AGENT_TOOLSDIRECTORY"
152+
"/usr/local/share/powershell"
153+
"/usr/local/share/chromium"
154+
"/usr/local/lib/node_modules"
155+
"/usr/share/miniconda/"
156+
"/usr/share/icons/"
157+
"/usr/share/az_*"
158+
"/usr/lib/heroku/"
159+
"/opt/ghc"
160+
"/usr/local/.ghcup"
161+
)
162+
163+
for dir in "${dirs_to_remove[@]}"; do
164+
removeDir "$dir"
165+
done
162166

163167
execAndMeasureSpaceChange removeAllSnaps "Snaps"
164168
execAndMeasureSpaceChange cleanPackages "Unused packages"

0 commit comments

Comments
 (0)