Last active
March 22, 2017 12:59
-
-
Save dillonhafer/8a65d835e01131ac6a57841436f73e8f to your computer and use it in GitHub Desktop.
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 gonew { | |
if (( $# == 1 )); then | |
new_project="$GOPATH/src/github.com/dillonhafer/$1" | |
if [ -d "$new_project" ]; then | |
echo -e "\033[0;31mProject already exists\033[0m" | |
return | |
fi | |
mkdir -p $new_project | |
cd $new_project | |
git init . | |
echo -e "$1" > .gitignore | |
echo -e "# $1" > README.md | |
$EDITOR main.go | |
else | |
echo "USAGE: gonew [folder]" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment