fixed bug where volumes argument would be set to an invalid value
This commit is contained in:
parent
9b013d9996
commit
665e356842
1 changed files with 8 additions and 4 deletions
|
|
@ -46,15 +46,19 @@ get_volumes() {
|
|||
local input_file="$1"
|
||||
local size="${2:-}"
|
||||
local volumes=""
|
||||
local smart_size
|
||||
local smart_size=""
|
||||
|
||||
if [[ -n "$size" ]]; then
|
||||
log "INFO" "Volumes size is set to ${size}MB"
|
||||
smart_size="$(calc_smart_volumes "$input_file" "$size" || echo -n)"
|
||||
volumes="-v${smart_size}m"
|
||||
smart_size="$(calc_smart_volumes "$input_file" "$size" || true)"
|
||||
fi
|
||||
|
||||
[[ -n "$volumes" ]] && log "INFO" "Volumes set to '$volumes'" || log "INFO" "Volumes argument unset"
|
||||
if [[ -n "$smart_size" ]]; then
|
||||
volumes="-v${smart_size}m"
|
||||
log "INFO" "Volumes set to '$volumes'"
|
||||
else
|
||||
log "INFO" "Volumes argument unset"
|
||||
fi
|
||||
|
||||
echo "$volumes"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue