Skip to content

Commit

Permalink
ci: improve cleanup script
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimovs committed Sep 3, 2024
1 parent 82da00f commit 5d9eb0e
Showing 1 changed file with 49 additions and 20 deletions.
69 changes: 49 additions & 20 deletions disk_cleanup_mac.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
#!/bin/bash

# Display disk usage before cleanup
df -h

# Cache 済み Docker Image の削除
# Removing cached Docker images
docker rmi $(docker images -q -a)
sudo docker image prune --all --force

# # ghcup の削除
# sudo rm -rf /usr/local/.ghcup
#
# # Swift の削除
# sudo rm -rf /usr/share/swift
#
# # Boost の削除
# sudo rm -rf /usr/local/share/boost
#
# # .Net Core の削除
# sudo rm -rf /usr/share/dotnet
#
# # Haskell の削除
# sudo rm -rf /opt/ghc

# Android SDK の削除
sudo rm -rf /usr/local/share/android-sdk
docker image prune --all --force

# Remove Homebrew cache
brew cleanup -s
brew autoremove -s
rm -rf $(brew --cache)

# Remove unused Xcode versions and simulators
sudo rm -rf /Applications/Xcode*
sudo rm -rf ~/Library/Developer/Xcode/DerivedData/*
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode
sudo rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
sudo rm -rf ~/Library/Developer/CoreSimulator/Devices/*

# Remove .NET SDK and runtimes
sudo rm -rf /usr/local/share/dotnet
sudo rm -rf ~/.dotnet

# Remove Haskell (GHC)
sudo rm -rf ~/.ghcup
sudo rm -rf /opt/ghc

# Remove Swift
sudo rm -rf /usr/share/swift

# Remove Android SDK
sudo rm -rf ~/Library/Android/sdk

# Remove Python environments and pip cache
sudo rm -rf ~/.pyenv
sudo rm -rf ~/Library/Caches/pip

# Remove Node.js and npm cache
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm -rf ~/.nvm

# Remove Ruby gems and cache
sudo rm -rf ~/.gem
sudo rm -rf ~/.rbenv

# Remove temporary files
sudo rm -rf /tmp/*
sudo rm -rf /private/var/tmp/*
sudo rm -rf /var/folders/*

# Display disk usage after cleanup
df -h

0 comments on commit 5d9eb0e

Please sign in to comment.