From 373c2edd8497d89370c9730e2789741e416faed7 Mon Sep 17 00:00:00 2001 From: Daniel de Cloet Date: Tue, 31 May 2022 13:36:10 +0200 Subject: [PATCH] Fix dynamic run_command_switches appending --- templates/zshrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/zshrc b/templates/zshrc index a71e1ab..9323d23 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -218,11 +218,14 @@ EOS index=$(docker ps -a --filter "name=docker-env-$image_repository-*" --format '{% raw %}{{.Names}}{% endraw %}' | perl -e 'my $max = 0; while (<>) {my ($n) = $_ =~ /(\d+)$/; if ($n > $max) { $max = $n };}; print $max+1;') name="docker-env-$image_repository-$index" - run_command="docker run --rm -it --name \"$name\" -v $(pwd):/work_dir " + run_command="docker run --rm -it --name \"$name\" -v \"$(pwd):/work_dir\" " - run_command+="${run_command_switches[*]}" + for run_command_switch in $run_command_switches + do + run_command+="\"$run_command_switch\" " + done - run_command+=" -w \"$workdir\" \"$image\" $cmd" + run_command+="-w \"$workdir\" \"$image\" $cmd" eval $run_command }