fix(git-clone): change to work with volumes fixes #79 (#80)

* fix(git-clone): change to work with volumes fixes #79

* Update git-clone/run.sh

Co-authored-by: Kyle Carberry <kyle@carberry.com>

---------

Co-authored-by: Muhammad Atif Ali <matifali@live.com>
Co-authored-by: Kyle Carberry <kyle@carberry.com>
pull/82/head
Scott 2 years ago committed by GitHub
parent dda094f168
commit 5b3bd80634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,16 +23,19 @@ if ! command -v git >/dev/null; then
exit 1 exit 1
fi fi
# Check if the directory exists... # Check if the directory for the cloning exists
# and if not, create it
if [ ! -d "$CLONE_PATH" ]; then if [ ! -d "$CLONE_PATH" ]; then
echo "Creating directory $CLONE_PATH..." echo "Creating directory $CLONE_PATH..."
mkdir -p "$CLONE_PATH" mkdir -p "$CLONE_PATH"
fi
# Check if the directory is empty
# and if it is, clone the repo, otherwise skip cloning
if [ -z "$(ls -A "$CLONE_PATH")" ]; then
echo "Cloning $REPO_URL to $CLONE_PATH..."
git clone "$REPO_URL" "$CLONE_PATH"
else else
echo "$CLONE_PATH already exists, skipping clone!" echo "$CLONE_PATH already exists and isn't empty, skipping clone!"
exit 0 exit 0
fi fi
# Clone the repository...
echo "Cloning $REPO_URL to $CLONE_PATH..."
git clone "$REPO_URL" "$CLONE_PATH"

Loading…
Cancel
Save