Bash create git repo for CAd files
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
# A bash function that will create a new git repo and configure the user.email | |
# Usage: Add this to your ~/.bashrc or ~/.bash_profile or ~/.zshrc files | |
function f360 { | |
_basepath="${HOME}/Code/github/spuder" | |
if [[ -z "$1" ]]; then echo "Usage: f360 foobar"; return 1; fi | |
if [[ ! -d "${_basepath}" ]]; then echo "${_basepath} doesn't exist"; return 1; fi | |
if [[ -d "${_basepath}/$1" ]]; then echo "Directory ${_basepath}/${1} already exists"; return 1; fi | |
echo "Creating ${_basepath}/${1}" | |
mkdir $_basepath/$1 | |
cd $_basepath/$1 | |
echo "running git init" | |
git init | |
echo "running git config" | |
git config user.email <redacted>@gmail.com | |
git config user.name "Spencer Owen" | |
#TODO: Create github repo | |
# git clone | |
#git submodule update --init | |
# rm CAD/* | |
# rm photos/* | |
# make clean | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment