File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -390,16 +390,18 @@ elif [ "$FORCE" = "1" ] && [ -e "$PREFIX" ]; then
390390fi
391391
392392total_installation_size_kb=" __TOTAL_INSTALLATION_SIZE_KB__"
393+ total_installation_size_mb=" $(( total_installation_size_kb / 1024 )) "
394+ if ! mkdir -p " $PREFIX " ; then
395+ printf " ERROR: Could not create directory: '%s'.\\ n" " $PREFIX " >&2
396+ printf " Check permissions and available disk space (%s MB needed).\\ n" " $total_installation_size_mb " >&2
397+ exit 1
398+ fi
399+
393400free_disk_space_kb=" $( df -Pk " $PREFIX " | tail -n 1 | awk ' {print $4}' ) "
394401free_disk_space_kb_with_buffer=" $(( free_disk_space_kb - 50 * 1024 )) " # add 50MB of buffer
395402if [ " $free_disk_space_kb_with_buffer " -lt " $total_installation_size_kb " ]; then
396403 printf " ERROR: Not enough free disk space. Only %s MB are available, but %s MB are required (leaving a 50 MB buffer).\\ n" \
397- " $(( free_disk_space_kb_with_buffer / 1024 )) " " $(( total_installation_size_kb / 1024 )) " >&2
398- exit 1
399- fi
400-
401- if ! mkdir -p " $PREFIX " ; then
402- printf " ERROR: Could not create directory: '%s'\\ n" " $PREFIX " >&2
404+ " $(( free_disk_space_kb_with_buffer / 1024 )) " " $total_installation_size_mb " >&2
403405 exit 1
404406fi
405407
You can’t perform that action at this time.
0 commit comments