From 4caa040cf84551ef305fe574a2a62f19ea5d0eba Mon Sep 17 00:00:00 2001 From: phg Date: Wed, 10 Sep 2025 16:35:22 +0200 Subject: [PATCH] refactor: use an array for m4b_tool_bin to prevent word-splitting issues in command execution --- to-m4b.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/to-m4b.sh b/to-m4b.sh index 540d0b0..bb79228 100755 --- a/to-m4b.sh +++ b/to-m4b.sh @@ -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() {