#!/usr/bin/env bash # Check: Sufficient disk space available # Returns 0 if >100MB available, 1 otherwise set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$SCRIPT_DIR")" : "${OUTPUT_DIR:=$SKILL_ROOT/outputs}" # Ensure output dir exists for df check mkdir -p "$OUTPUT_DIR" # Get available space in KB avail=$(df -P "$OUTPUT_DIR" | awk 'NR==2 {print $4}') # Require at least 100MB (102400 KB) [[ "$avail" -ge 102400 ]]