Suggest a way forward if the requested container is already present

This should smoothen the onboarding experience by making the commands
self-documenting.

https://github.com/debarshiray/toolbox/issues/59
This commit is contained in:
Debarshi Ray 2019-04-17 12:08:26 +02:00
parent 6e9dc4ad89
commit 73980079ff

View file

@ -690,8 +690,11 @@ create()
echo "$base_toolbox_command: checking if container $toolbox_container already exists" >&3
enter_command=$(create_enter_command "$toolbox_container")
if $prefix_sudo podman inspect --type container $toolbox_container >/dev/null 2>&3; then
echo "$base_toolbox_command: container $toolbox_container already exists" >&2
echo "Enter with: $enter_command" >&2
echo "Try '$base_toolbox_command --help' for more information." >&2
exit 1
fi
@ -753,8 +756,6 @@ create()
fi
echo "Created container: $toolbox_container"
enter_command=$(create_enter_command "$toolbox_container")
echo "Enter with: $enter_command"
)