Created
February 10, 2022 18:28
-
-
Save tassaron/2cd2a0f35601bf035d7d4b139c17b79e to your computer and use it in GitHub Desktop.
script to make cloning my own repos faster
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
function gc () { | |
local returnval=n | |
function ynprompt () { | |
read -r -p "Clone ${1}? [Y/n] " input | |
case $input in | |
[yY][eE][sS]|[yY]) | |
returnval=y | |
;; | |
esac | |
} | |
function dowork () { | |
local url=https://github.com/tassaron/"${1}" | |
ynprompt $url | |
if [ $returnval == y ]; then | |
git clone $url | |
fi | |
} | |
dowork $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment