Last active
September 3, 2020 21:51
-
-
Save wzdiyb/6b230f17b9032d5007dd7be89d8cc40d to your computer and use it in GitHub Desktop.
Download Github Repos as zip
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
#!/bin/bash | |
# Zip Directory | |
zip_dir='PATH' # Absolute/Relative Path | |
cd $zip_dir | |
# Timestamp | |
timestamp=$(date +%Y%m%d-%H%M%S) | |
mkdir $timestamp | |
cd $timestamp | |
# Download | |
for rep in $(cat $zip_dir/list); do | |
#git clone rep | |
echo "Downloading: " $rep | |
url=$rep | |
rep_name=$(echo $rep | cut -d '/' -f 5) | |
curl -L -H "Authorization: token <token>" $url/archive/master.zip > $rep_name.zip | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment