-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
31 lines (26 loc) · 762 Bytes
/
Copy pathsetup.sh
File metadata and controls
31 lines (26 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Setup script for the youcoded-dev workspace.
# Clones or pulls the latest from all project repos into the current directory.
set -euo pipefail
REPOS=(
"itsdestin/youcoded:master"
"itsdestin/youcoded-core:master"
"itsdestin/youcoded-admin:master"
"itsdestin/wecoded-themes:main"
"itsdestin/wecoded-marketplace:master"
)
for entry in "${REPOS[@]}"; do
repo="${entry%%:*}"
branch="${entry##*:}"
name="${repo##*/}"
if [ -d "$name/.git" ]; then
echo "Updating $name..."
git -C "$name" fetch origin
git -C "$name" pull origin "$branch"
else
echo "Cloning $name..."
git clone --branch "$branch" "https://github.com/$repo.git" "$name"
fi
done
echo ""
echo "Workspace ready. All repos are up to date."