Initial import of verae-bootstrap from zapier monorepo
This commit is contained in:
commit
e6bbbaffe8
18 changed files with 353 additions and 0 deletions
22
scripts/clone.sh
Executable file
22
scripts/clone.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
# Clone Forgejo modules listed in a repos file.
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
GITSSH="${GITSSH:-ssh://git@git.georgelambert.org:2223/marchon}"
|
||||
DEST="${VERAE_SRC:-$HOME/verae-src}"
|
||||
LIST="${1:-$ROOT/repos.txt}"
|
||||
export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-ssh -o StrictHostKeyChecking=accept-new -p 2223}"
|
||||
mkdir -p "$DEST"
|
||||
while read -r name; do
|
||||
[[ -z "$name" || "$name" == \#* ]] && continue
|
||||
if [[ -d "$DEST/$name/.git" ]]; then
|
||||
echo "fetch $name"
|
||||
git -C "$DEST/$name" fetch --prune origin
|
||||
git -C "$DEST/$name" checkout -q main 2>/dev/null || git -C "$DEST/$name" checkout -q master
|
||||
git -C "$DEST/$name" pull --ff-only || true
|
||||
else
|
||||
echo "clone $name"
|
||||
git clone "$GITSSH/${name}.git" "$DEST/$name"
|
||||
fi
|
||||
done < "$LIST"
|
||||
echo "cloned into $DEST"
|
||||
Loading…
Add table
Add a link
Reference in a new issue