refactor: use an array for m4b_tool_bin to prevent word-splitting issues in command execution

This commit is contained in:
Philip Henning 2025-09-10 16:35:22 +02:00
parent 39a341d193
commit 4caa040cf8

View file

@ -4,6 +4,8 @@ set -eufo pipefail
# CONSTANTS
declare -r script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Use an array for the executable to avoid word-splitting issues
declare -ra m4b_tool_bin=(nix run github:sandreas/m4b-tool#m4b-tool-libfdk --)
# VARS
LEADING_ZEROES=2
@ -178,7 +180,7 @@ m4b-merge() {
fi
args+=("--output-file=${output_file}" -- "${source_dir}")
nix run github:sandreas/m4b-tool#m4b-tool-libfdk -- "${args[@]}"
"${m4b_tool_bin[@]}" "${args[@]}"
}
main() {