Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 5b3bd80

Browse files
smolinarimatifalikylecarbs
authored
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 <[email protected]> --------- Co-authored-by: Muhammad Atif Ali <[email protected]> Co-authored-by: Kyle Carberry <[email protected]>
1 parent dda094f commit 5b3bd80

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

git-clone/run.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ if ! command -v git >/dev/null; then
2323
exit 1
2424
fi
2525

26-
# Check if the directory exists...
26+
# Check if the directory for the cloning exists
27+
# and if not, create it
2728
if [ ! -d "$CLONE_PATH" ]; then
2829
echo "Creating directory $CLONE_PATH..."
2930
mkdir -p "$CLONE_PATH"
31+
fi
32+
33+
# Check if the directory is empty
34+
# and if it is, clone the repo, otherwise skip cloning
35+
if [ -z "$(ls -A "$CLONE_PATH")" ]; then
36+
echo "Cloning $REPO_URL to $CLONE_PATH..."
37+
git clone "$REPO_URL" "$CLONE_PATH"
3038
else
31-
echo "$CLONE_PATH already exists, skipping clone!"
39+
echo "$CLONE_PATH already exists and isn't empty, skipping clone!"
3240
exit 0
3341
fi
34-
35-
# Clone the repository...
36-
echo "Cloning $REPO_URL to $CLONE_PATH..."
37-
git clone "$REPO_URL" "$CLONE_PATH"
38-

0 commit comments

Comments
 (0)