Created
December 20, 2013 15:55
-
-
Save yorkie/8056734 to your computer and use it in GitHub Desktop.
download github folder and project without cloning...
This file contains hidden or 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
##################################################### | |
# Download Specific folders from Github using SVN | |
# | |
# Author: Declan Cook | |
# Licence: MIT | |
##################################################### | |
GHDOMAIN="https://github.com/" | |
IN=$1 | |
IN=${IN##$GHDOMAIN} | |
BRANCH="trunk" | |
FOLDER="" | |
IFS="/" read -a SECT <<< "$IN" | |
if [[ "${SECT[3]}" != "master" ]]; then | |
BRANCH=${SECT[3]} | |
fi | |
for index in "${!SECT[@]}"; do | |
if [ $index -gt 3 ]; then | |
FOLDER=$FOLDER/${SECT[index]} | |
fi | |
done | |
# DOMAIN/USER/PROJECT/<TRUNK||BRANCH>/FOLDER | |
echo Exporting $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER | |
svn export $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment