Fix issue with golang template having same syntax as jinja2

This commit is contained in:
Daniel_I_Am 2021-12-27 15:50:23 +01:00
parent 8bab72ac23
commit 95c237d2e8

View File

@ -152,7 +152,7 @@ function docker-env() {
echo "Usage: docker-env <image_name> [command]" echo "Usage: docker-env <image_name> [command]"
return 1 return 1
else else
index=$(docker ps -a --filter "name=docker-env-$1-*" --format '{{.Names}}' | 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-$1-*" --format '{% raw %}{{.Names}}{% endraw %}' | perl -e 'my $max = 0; while (<>) {my ($n) = $_ =~ /(\d+)$/; if ($n > $max) { $max = $n };}; print $max+1;')
docker run --rm --name "docker-env-$1-$index" -it -v "$(pwd):/work_dir" -w "/work_dir" "$1" "${2:-bash}" docker run --rm --name "docker-env-$1-$index" -it -v "$(pwd):/work_dir" -w "/work_dir" "$1" "${2:-bash}"
fi fi
} }