34 lines
		
	
	
		
			611 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			611 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
echo "[GIT]"
 | 
						|
 | 
						|
if [ ! `command -v "git"` ]; then
 | 
						|
    if [ ! `command -v "brew"` ]; then
 | 
						|
        echo "Homebrew is required!"
 | 
						|
        exit
 | 
						|
    fi
 | 
						|
 | 
						|
    echo
 | 
						|
    echo "* Installing git"
 | 
						|
    brew install git
 | 
						|
fi
 | 
						|
 | 
						|
if [ ! -e /usr/local/bin/branch ]; then
 | 
						|
    echo
 | 
						|
    echo "* Installing git-friendly"
 | 
						|
 | 
						|
    # https://github.com/jamiew/git-friendly
 | 
						|
    bash < <(curl https://raw.github.com/jamiew/git-friendly/master/install.sh)
 | 
						|
fi
 | 
						|
 | 
						|
# Create links
 | 
						|
echo
 | 
						|
echo "* Setting up symlinks"
 | 
						|
src=$(cd "$(dirname "$0")/.."; pwd)
 | 
						|
 | 
						|
ln -sf $src/gitignore ~/.gitignore
 | 
						|
ln -sf $src/gitconfig ~/.gitconfig
 | 
						|
 | 
						|
echo
 | 
						|
echo "Done!"
 |