Skip to content

Commit

Permalink
Exit if update can't see free disk space
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Nov 3, 2023
1 parent 1d558b5 commit e47dd55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wemd
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ update() {
if ! [[ "${__free_space}" =~ $re ]] ; then
echo "Unable to determine free disk space. This is likely a bug."
echo "df reports $(df -P "$(pwd)") and __free_space is ${__free_space}"
exit 130
elif [ "$(df -P "$(pwd)" | awk '/[0-9]%/{print $(NF-2)}')" -lt 1024 ]; then
echo "You have less than 1 MiB of space left on $(pwd)."
echo "Aborting, as an update is not safe."
Expand Down

0 comments on commit e47dd55

Please sign in to comment.