diff --git a/templates/zshrc b/templates/zshrc index 6ff99c2..e76ad0b 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -165,6 +165,7 @@ function docker-env() { port= workdir=/work_dir volumes=("$(pwd):/work_dir") + envvars=() while do @@ -177,6 +178,10 @@ function docker-env() { port="$2" shift ;; + -e) + envvars+=("$2") + shift + ;; -v) volumes+=("$2") shift @@ -204,6 +209,7 @@ Usage: docker-env [OPTIONS] [--] IMAGE [COMMAND] [ARG...] Options: -p Publish a container's port(s) to the host + -e VAR=value Add environment variable VAR with value -v Bind mount a volume EOS return 1 @@ -227,6 +233,10 @@ EOS do run_command+=" -v $volume" done + for envvar in $envvars + do + run_command+=" -e \"$envvar\"" + done run_command+=" -w \"$workdir\" $image $cmd"