25 lines · 497 B · Text
RawDownload
#!/usr/bin/env bash set -eu if [[ $# -ne 1 ]]; then    echo "usage: $0 <MAX_SIZE_IN_GB>"    exit 1fi if ! [[ -d target ]]; then    echo "target directory does not exist yet"    exit 0fi max_size_gb=$1 current_size=$(du -s target | cut -f1)current_size_gb=$(expr ${current_size} / 1024 / 1024) echo "target directory size: ${current_size_gb}gb. max size: ${max_size_gb}gb" if [[ ${current_size_gb} -gt ${max_size_gb} ]]; then    echo "clearing target directory"    rm -rf targetfi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t