From 5b430b9503b9a451d09cad21b3e073f2b7bfae3d Mon Sep 17 00:00:00 2001 From: TannerGabriel Date: Mon, 8 Nov 2021 21:17:19 +0100 Subject: [PATCH 1/2] Check if example directory exists Signed-off-by: TannerGabriel --- quickstart/multistage-delivery.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/quickstart/multistage-delivery.sh b/quickstart/multistage-delivery.sh index 2e2fc8f..b1c7bcb 100755 --- a/quickstart/multistage-delivery.sh +++ b/quickstart/multistage-delivery.sh @@ -98,7 +98,17 @@ verify_helm_installation print_headline "Downloading demo resources" echo "This will create a local folder ./examples" echo "git clone https://github.com/keptn/examples --single-branch" -git clone https://github.com/keptn/examples --single-branch + +DIR="./examples" +BOLD='\033[1m' +if [ -d "$DIR" ]; then + # Example directory already exists + echo -e "\n${BOLD}Example directory already exists in folder. Skipping download!" +else + # Example Directory does not exist + git clone https://github.com/keptn/examples --single-branch +fi + cd examples/quickstart print_headline "Create a Keptn project" From 27cd4f14631ed0f51be744103737f8a1b02a559c Mon Sep 17 00:00:00 2001 From: TannerGabriel Date: Thu, 16 Dec 2021 19:03:27 +0100 Subject: [PATCH 2/2] Fix echo formatting Signed-off-by: TannerGabriel --- quickstart/multistage-delivery.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstart/multistage-delivery.sh b/quickstart/multistage-delivery.sh index b1c7bcb..3ecdf61 100755 --- a/quickstart/multistage-delivery.sh +++ b/quickstart/multistage-delivery.sh @@ -101,9 +101,10 @@ echo "git clone https://github.com/keptn/examples --single-branch" DIR="./examples" BOLD='\033[1m' +NORMAL='\033[0m' if [ -d "$DIR" ]; then # Example directory already exists - echo -e "\n${BOLD}Example directory already exists in folder. Skipping download!" + echo -e "\n${BOLD}Example directory already exists in folder. Skipping download!${NORMAL}" else # Example Directory does not exist git clone https://github.com/keptn/examples --single-branch