Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

fix: Check if example directory already exists #206

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

TannerGabriel
Copy link
Member

Currently, when the multistage-delivery.sh script of the quickstarter example is run multiple times, it fails since the examples repository already exists.

fatal: destination path 'examples' already exists and is not an empty directory.

Now the existence of the directory gets checked before cloning the repository to remove the possibility of this error.

Fixes

Keptn.sh issue

@TannerGabriel
Copy link
Member Author

Another option would be to ask the user if he wants to replace the directory.

read -p "Examples directory already exists. Want to overwrite it (y/n)?" choice
case "$choice" in 
  y|Y ) echo "Replace directory";;
  n|N ) echo "Keep old directory";;
  * ) echo "invalid";;
esac

@TannerGabriel TannerGabriel force-pushed the fix/check-if-directory-exists branch from cc99d4a to 5b430b9 Compare November 11, 2021 09:13
Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com>
@TannerGabriel TannerGabriel force-pushed the fix/check-if-directory-exists branch from 0231404 to a8ca180 Compare December 16, 2021 17:57
Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com>
@TannerGabriel TannerGabriel force-pushed the fix/check-if-directory-exists branch from a8ca180 to 27cd4f1 Compare December 16, 2021 18:03
@TannerGabriel TannerGabriel merged commit 4c82a62 into master Dec 20, 2021
@TannerGabriel TannerGabriel deleted the fix/check-if-directory-exists branch December 20, 2021 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants