File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ function set_docker_options_with_value() {
4040 local help_output
4141 help_output=" $( " ${docker_path} " " ${command[@]} " --help) "
4242
43- local help_lines
44- readarray -t help_lines <<< " ${help_output}"
43+ local help_lines=()
44+ if [[ -n " ${help_output} " ]]; then
45+ readarray -t help_lines <<< " ${help_output}"
46+ fi
47+ unset help_output
48+
4549 docker_options_with_value=()
4650 for line in " ${help_lines[@]} " ; do
4751 # second group is the short option (optional)
@@ -110,14 +114,20 @@ function set_container_root_on_host() {
110114# Reads the mounts of the current/parent container and stores them in the
111115# parent_container_mounts array.
112116function set_parent_container_mounts() {
113- local docker_output
114- docker_output =$(
117+ local inspect_output
118+ inspect_output =$(
115119 " ${docker_path} " inspect \
116120 --format ' {{range .Mounts}}{{if or (eq .Type "bind") (eq .Type "volume")}}{{printf "%s:%s\n" .Source .Destination}}{{end}}{{end}}' \
117121 " ${container_id} "
118122 )
119123
120- readarray -t parent_container_mounts <<< " ${docker_output}"
124+ if [[ -n " ${inspect_output} " ]]; then
125+ readarray -t parent_container_mounts <<< " ${inspect_output}"
126+ else
127+ parent_container_mounts=()
128+ fi
129+ unset inspect_output
130+
121131 readonly parent_container_mounts
122132}
123133
You can’t perform that action at this time.
0 commit comments