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 }