updated git_update_repos.sh

pull/2/head
Hari Sekhon 5 years ago
parent bd3abca2db
commit faa4015300

@ -25,11 +25,26 @@ mkdir -pv "$git_base_dir"
cd "$git_base_dir" cd "$git_base_dir"
run(){ repofile="$srcdir/setup/repolist.txt"
local repofile="$1"
if [ $# -gt 0 ]; then
repolist="$*"
else
repolist="${*:-${REPOS:-}}"
if [ -n "$repolist" ]; then
:
elif [ -f "$repofile" ]; then
echo "processing repos from file: $repofile" echo "processing repos from file: $repofile"
echo repolist="$(sed 's/#.*//; /^[[:space:]]*$/d' < "$repofile")"
while read -r repo; do else
echo "fetching repos from GitHub repo list"
repolist="$(curl -sL https://raw.githubusercontent.com/HariSekhon/bash-tools/master/setup/repolist.txt | sed 's/#.*//')"
fi
fi
run(){
local repolist="$*"
for repo in $repolist; do
repo_dir="${repo##*/}" repo_dir="${repo##*/}"
repo_dir="${repo_dir##*:}" repo_dir="${repo_dir##*:}"
repo="${repo%%:*}" repo="${repo%%:*}"
@ -51,13 +66,7 @@ run(){
else else
git clone "$git_url/$repo" "$repo_dir" git clone "$git_url/$repo" "$repo_dir"
fi fi
done < <(sed 's/#.*//; /^[[:space:]]*$/d' < "$repofile") done
} }
if [ $# -gt 0 ]; then run "$repolist"
for x in "$@"; do
run "$x"
done
else
run "$srcdir/setup/repolist.txt"
fi

Loading…
Cancel
Save