Fix dynamic run_command_switches appending

This commit is contained in:
Daniel_I_Am 2022-05-31 13:36:10 +02:00
parent b54f091941
commit 373c2edd84

View File

@ -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;') 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" 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 eval $run_command
} }