-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto npm the github api for really-pull-all
Add `-s` flag that will opt into using SSH paths
- Loading branch information
Showing
2 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,20 @@ if [[ $OS = "Windows_NT" ]]; then | |
fi | ||
|
||
# default to https auth | ||
POLYMER_PATH=${POLYMER_PATH:-"https://github.com/Polymer"} | ||
SSH=0 | ||
|
||
# Short names for all the repos | ||
REPOS=( | ||
REPOS=() | ||
REPO_PATHS=() | ||
|
||
prepare() { | ||
if [ $SSH -eq 1 ]; then | ||
POLYMER_PATH="[email protected]:Polymer" | ||
else | ||
POLYMER_PATH="https://github.com/Polymer" | ||
fi | ||
|
||
# Short names for all the repos | ||
REPOS=( | ||
CustomElements | ||
HTMLImports | ||
MutationObservers | ||
|
@@ -27,18 +37,19 @@ REPOS=( | |
polymer | ||
polymer-expressions | ||
tools | ||
) | ||
) | ||
|
||
# Array of all the repos with full path | ||
REPO_PATHS=() | ||
# Array of all the repos with full path | ||
REPO_PATHS=() | ||
|
||
for REPO in ${REPOS[@]}; do | ||
REPO_PATHS+=("$POLYMER_PATH/$REPO.git") | ||
done | ||
for REPO in ${REPOS[@]}; do | ||
REPO_PATHS+=("$POLYMER_PATH/$REPO.git") | ||
done | ||
|
||
# Web Animations has its own org, hardcode full path | ||
REPOS+=("web-animations-js") | ||
REPO_PATHS+=("https://github.com/web-animations/web-animations-js.git") | ||
# Web Animations has its own org, hardcode full path | ||
REPOS+=("web-animations-js") | ||
REPO_PATHS+=("https://github.com/web-animations/web-animations-js.git") | ||
} | ||
|
||
# repos that fail to clone will be put here | ||
FAILED=() | ||
|
@@ -132,8 +143,11 @@ sync_repos() { | |
# only sync if run, not if importing functions | ||
if [ ${0##*[/\\]} == "pull-all.sh" ]; then | ||
# figure out what branch to pull with the -v "version" argument | ||
while getopts ":v:" opt; do | ||
while getopts ":v:s" opt; do | ||
case $opt in | ||
s) | ||
SSH=1 | ||
;; | ||
v) | ||
BRANCH="$OPTARG" | ||
;; | ||
|
@@ -142,5 +156,6 @@ if [ ${0##*[/\\]} == "pull-all.sh" ]; then | |
;; | ||
esac | ||
done | ||
prepare | ||
sync_repos | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,35 @@ if [[ $OS = "Windows_NT" ]]; then | |
WINDOWS=1 | ||
fi | ||
|
||
# default to https auth | ||
GIT_PATH=${GIT_PATH:-"https://github.com/polymer-elements"} | ||
REPOS=() | ||
REPO_PATHS=() | ||
SSH=0 | ||
|
||
# Short names for all the repos | ||
script="${0%[/\\]*}/all-repos.js" | ||
echo -e "\033[1;34m===== Fetching \033[1;37mGithub Repos \033[1;34m=====\033[0m" | ||
REPOS=(`node $script polymer-elements`) | ||
prepare() { | ||
# default to https auth | ||
if [ $SSH -eq 1 ]; then | ||
GIT_PATH="[email protected]:polymer-elements" | ||
else | ||
GIT_PATH="https://github.com/polymer-elements" | ||
fi | ||
|
||
# Array of all the repos with full path | ||
REPO_PATHS=() | ||
# boostrap github api | ||
pushd ${0%[/\\]*} > /dev/null | ||
npm install | ||
popd > /dev/null | ||
|
||
# Gather repo list from github | ||
script="${0%[/\\]*}/all-repos.js" | ||
echo -e "\033[1;34m===== Fetching \033[1;37mGithub Repos \033[1;34m=====\033[0m" | ||
REPOS=(`node $script polymer-elements`) | ||
|
||
for REPO in ${REPOS[@]}; do | ||
REPO_PATHS+=("$GIT_PATH/$REPO.git") | ||
done | ||
# Array of all the repos with full path | ||
REPO_PATHS=() | ||
|
||
for REPO in ${REPOS[@]}; do | ||
REPO_PATHS+=("$GIT_PATH/$REPO.git") | ||
done | ||
} | ||
|
||
# repos that fail to clone will be put here | ||
FAILED=() | ||
|
@@ -115,8 +130,11 @@ sync_repos() { | |
# only sync if run, not if importing functions | ||
if [ ${0##*[/\\]} == "really-pull-all.sh" ]; then | ||
# figure out what branch to pull with the -v "version" argument | ||
while getopts ":v:" opt; do | ||
while getopts ":v:s" opt; do | ||
case $opt in | ||
s) | ||
SSH=1 | ||
;; | ||
v) | ||
BRANCH="$OPTARG" | ||
;; | ||
|
@@ -125,5 +143,6 @@ if [ ${0##*[/\\]} == "really-pull-all.sh" ]; then | |
;; | ||
esac | ||
done | ||
prepare | ||
sync_repos | ||
fi |