From 96e65508d141c55c34d2a6824c3fe28650c94257 Mon Sep 17 00:00:00 2001 From: sometimesuseful <> Date: Tue, 12 Nov 2024 16:04:51 +0000 Subject: [PATCH] shellcheck --- modules/archive.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/archive.sh b/modules/archive.sh index f5ee030..a1043b4 100755 --- a/modules/archive.sh +++ b/modules/archive.sh @@ -10,7 +10,7 @@ trap 'cleanup' ERR INT cleanup() { if [[ -n "$archive" ]]; then rm -f "${archive}"* - log "INFO" "Cleaning up $(basename $archive) remains before exit" + log "INFO" "Cleaning up $(basename "$archive") remains before exit" fi } @@ -55,7 +55,7 @@ set_volumes() { local volumes="" if [[ -n "$size" ]]; then - smart_size="$(calc_smart_volumes $input_file $size || echo -n)" + smart_size="$(calc_smart_volumes "$input_file" "$size" || echo -n)" volumes="-v${smart_size}m" fi @@ -66,7 +66,7 @@ set_volumes() { # Generates a random archive name of 20 alphanumeric characters generate_name() { - archive="$archive_dir/$(tr -dc [:alnum:] < /dev/urandom | head -c 20).7z" + archive="$archive_dir/$(tr -dc '[:alnum:]' < /dev/urandom | head -c 20).7z" log "INFO" "Generated archive name '$archive'" @@ -100,7 +100,7 @@ main() { exit 1 fi - volumes="$(set_volumes $input_file $size)" + volumes="$(set_volumes "$input_file" "$size")" archive="$(generate_name)" log "INFO" "Packing '${input_file}' into archive '$archive' with password '${archive_pwd}'"