Last active
March 16, 2020 14:12
-
-
Save stevenliebregt/0f0558ce0e7a788b17f13effd19ae9e3 to your computer and use it in GitHub Desktop.
Clone All RawNeal because I am lazy
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
CLONE_METHOD=${1:-ssh} | |
BASE_CLONE_COMMAND="git clone" | |
REPO_OWNER=Cdalmaij | |
declare -a REPOS=( | |
"Proof_Of_Concept" | |
"Backend" | |
"Frontend_Hybrid" | |
"Frontend_Browser" | |
"Architecture_Models" | |
) | |
fix_shitty_repo_name() { | |
OUTPUT=$(sed --expression 's/\([A-Z]\)/-\L\1/g' --expression 's/^-//' <<< "$1") | |
echo "${OUTPUT//_}" | |
} | |
make_clone_command() { | |
if [ $CLONE_METHOD = "ssh" ]; then | |
BASE_CLONE_COMMAND="$BASE_CLONE_COMMAND [email protected]:" | |
elif [ $CLONE_METHOD = "https" ]; then | |
BASE_CLONE_COMMAND="$BASE_CLONE_COMMAND https://github.com/" | |
fi | |
echo "$BASE_CLONE_COMMAND$REPO_OWNER/" | |
} | |
clone() { | |
for repo in "${REPOS[@]}" | |
do | |
SHITTY_REPO_NAME=Rawneal_$repo | |
NON_SHITTY_REPO_NAME=$(fix_shitty_repo_name $SHITTY_REPO_NAME) | |
CLONE_COMMAND="$1$SHITTY_REPO_NAME $NON_SHITTY_REPO_NAME" | |
$CLONE_COMMAND | |
done | |
} | |
echo "Howdy!" | |
mkdir -p rawneal | |
cd rawneal | |
clone "`make_clone_command`" | |
echo "Bye bye!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment