Skip to content

Commit d570a14

Browse files
committed
Skip checking free space on macOS during restore
Stopgap for #124.
1 parent 6713bb9 commit d570a14

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

functions/restore_func.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ function restore_func() {
3434

3535
# Ensure there's enough space to extract the archive on the device
3636
# Note: this is a very rough estimate as we're not taking the compression ratio into account
37-
archive_size_kb=$(stat --printf="%s" "$archive_path" | awk '{print $1/1024}')
38-
if ! enough_free_space "." "$archive_size_kb"; then
39-
cecho "Less than $archive_size_kb KB of free space available on the current directory - not enough to extract this backup."
40-
cecho "Please free up some space and try again."
41-
exit 1
37+
# This doesn't work on macOS so we'll skip it there
38+
if [[ "$(uname)" != "Darwin" ]]; then
39+
archive_size_kb=$(stat --printf="%s" "$archive_path" | awk '{print $1/1024}')
40+
if ! enough_free_space "." "$archive_size_kb"; then
41+
cecho "Less than $archive_size_kb KB of free space available on the current directory - not enough to extract this backup."
42+
cecho "Please free up some space and try again."
43+
exit 1
44+
fi
4245
fi
4346

4447
cecho "Extracting archive."

0 commit comments

Comments
 (0)