From 95c2405b307ced0da82b94bfb2accc8af20cfd12 Mon Sep 17 00:00:00 2001 From: jpellizzari Date: Mon, 20 Mar 2017 08:54:05 -0700 Subject: [PATCH] Changed --dry-run command to execute after OSX setup --- scope | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scope b/scope index 081817c01a..9dc54f2611 100755 --- a/scope +++ b/scope @@ -203,6 +203,13 @@ print_app_endpoints() { done } +dry_run() { + # Do a dry run of scope in the foreground, so it can parse args etc + # avoiding the entrypoint script in the process. + # shellcheck disable=SC2046 + docker run --rm --entrypoint=/home/weave/scope $(docker_args) "$SCOPE_IMAGE" --dry-run "$@" +} + check_docker_access check_docker_version @@ -232,11 +239,6 @@ case "$COMMAND" in ;; launch) - # Do a dry run of scope in the foreground, so it can parse args etc - # avoiding the entrypoint script in the process. - # shellcheck disable=SC2046 - docker run --rm --entrypoint=/home/weave/scope $(docker_args) "$SCOPE_IMAGE" --dry-run "$@" - if check_docker_for_mac; then create_plugins_dir if check_probe_only; then @@ -248,6 +250,7 @@ case "$COMMAND" in # access to host ports of the VM. # - https://github.com/weaveworks/scope/issues/1411 # - https://forums.docker.com/t/ports-in-host-network-namespace-are-not-accessible/10789 + dry_run "$@" check_not_running "$SCOPE_APP_CONTAINER_NAME" "$SCOPE_IMAGE_NAME" check_not_running "$SCOPE_CONTAINER_NAME" "$SCOPE_IMAGE_NAME" docker rm -f "$SCOPE_APP_CONTAINER_NAME" >/dev/null 2>&1 || true @@ -260,7 +263,7 @@ case "$COMMAND" in print_app_endpoints "localhost" exit fi - + dry_run "$@" launch "$@" if ! check_probe_only; then # shellcheck disable=SC2086