-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclone-windup.sh
More file actions
executable file
·33 lines (28 loc) · 1.02 KB
/
Copy pathclone-windup.sh
File metadata and controls
executable file
·33 lines (28 loc) · 1.02 KB
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
32
#!/bin/sh
#
# Clones all projects needed to work on core Windup and adds upstream remotes.
#
# Usage [from parent directory of projects to be created]:
# clone-windup.sh ORIGIN_ACCOUNT
#
# Scripts that want to do something with the latest master can pass "windup" for
# ORIGIN_ACCOUNT.
if [[ -z $1 ]]; then
echo "error: github origin account is required"
exit 1
fi
readonly ORIGIN_ACCOUNT=$1
readonly UPSTREAM_ACCOUNT="windup"
readonly PROJECTS_ORDERED="windup windup-rulesets windup-distribution"
for project in $PROJECTS_ORDERED; do
# Use https:// path for remotes pointing to the upstream repo so it's not so
# easy to accidentally push to it (since you'll be prompted for a password.)
origin_remote_path="https://github.com/$ORIGIN_ACCOUNT/${project}.git"
if [[ $ORIGIN_ACCOUNT != $UPSTREAM_ACCOUNT ]]; then
origin_remote_path="git@github.com:$ORIGIN_ACCOUNT/${project}.git"
fi
git clone $origin_remote_path
cd $project
git remote add upstream https://github.com/$UPSTREAM_ACCOUNT/${project}.git
cd ..
done