Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch: - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36 lines
1.0 KiB
Bash
Executable File
36 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
|
echo "usage: $0 <MAX_SIZE_IN_GB> [SMALL_CLEAN_SIZE_IN_GB]"
|
|
exit 1
|
|
fi
|
|
|
|
if ! [[ -d target ]]; then
|
|
echo "target directory does not exist yet"
|
|
exit 0
|
|
fi
|
|
|
|
max_size_gb=$1
|
|
small_clean_size_gb=${2:-}
|
|
|
|
if [[ -n "${small_clean_size_gb}" && ${small_clean_size_gb} -ge ${max_size_gb} ]]; then
|
|
echo "error: small clean threshold (${small_clean_size_gb}gb) must be smaller than max size (${max_size_gb}gb)"
|
|
exit 1
|
|
fi
|
|
|
|
current_size=$(du -s target | cut -f1)
|
|
current_size_gb=$(( ${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"
|
|
shopt -s dotglob
|
|
rm -rf target/*
|
|
elif [[ -n "${small_clean_size_gb}" && ${current_size_gb} -gt ${small_clean_size_gb} ]]; then
|
|
echo "running cargo clean --workspace (size above small clean threshold of ${small_clean_size_gb}gb)"
|
|
cargo clean --workspace
|
|
fi
|