Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Commit

Permalink
pulling and zipping :)
Browse files Browse the repository at this point in the history
  • Loading branch information
montyanderson committed Sep 9, 2019
1 parent 5a8b021 commit 6aefe53
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions github_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,20 @@ function download_user_repos() {
name="$(jq -r ".full_name" <<< "$repo")"
url="$(jq -r ".html_url" <<< "$repo")"

# check if file is already downloaded
if [ -d "./${name}" ]; then
echo "Repo ${name} exists. Skipping..."
# save metadata and video with concat
else
echo "Cloning ${name}...";
git clone $url $name
fi
# if repo already cloned
if [ -d "$name" ]; then
echo "Updating ${name}...";
# force pull
cd $name;
git pull -f;
cd ../../;
else
# clone from scratch
echo "Cloning ${name}...";
git clone $url $name;
fi

zip -r "$name.zip" $name

done

Expand Down

0 comments on commit 6aefe53

Please sign in to comment.