feat: finished editable profiles; profile prop to pull or not on build; profile props to set alternate component repos

This commit is contained in:
Gabriele Musco 2023-06-25 15:25:15 +02:00
commit 5382ff92d2
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE
21 changed files with 418 additions and 112 deletions

View file

@ -6,9 +6,10 @@ set -ev
GIT_URL=$1
REPO_DIR=$2
DO_PULL=$3
_usage() {
echo "Usage: $0 GIT_URL REPO_DIR"
echo "Usage: $0 GIT_URL REPO_DIR [DO_PULL]"
exit 1
}
@ -20,12 +21,19 @@ if [[ -z $GIT_URL ]]; then
_usage
fi
if [[ -z $DO_PULL ]]; then
DO_PULL=1
fi
if [[ -d "$REPO_DIR" ]]; then
if [[ ! -d "$REPO_DIR/.git" ]]; then
echo "Error: $REPO_DIR exists but is not a git repository"
exit 1
rmdir "$REPO_DIR"
git clone "$GIT_URL" "$REPO_DIR" --recurse-submodules
else
if [[ "$DO_PULL" -eq 1 ]]; then
git -C "$REPO_DIR" pull
fi
fi
git -C "$REPO_DIR" pull
else
git clone "$GIT_URL" "$REPO_DIR" --recurse-submodules
fi