dotfiles

Files to recover my file system.
git clone git://git.b1t.dev/dotfiles.git
Log | Files | Refs | README

mac.sh (1025B)


      1 #!/bin/bash
      2 GITHUB_USERNAME="RamonAsuncion"
      3 REPOSITORY="dotfiles" 
      4 FILE=".dotfiles"
      5 
      6 # Download the dotfiles to the home directory.
      7 git clone https://github.com/$GITHUB_USERNAME/$REPOSITORY.git $HOME/$FILE
      8 
      9 # Create the symbolic links.
     10 ln -s $HOME/$FILE/.zshrc $HOME/.zshrc
     11 ln -s $HOME/$FILE/.gitconfig $HOME/.gitconfig
     12 
     13 # Ask the user if they want to install homebrew.
     14 read -r -p "Install Homebrew [Y/n]: " response 
     15 
     16 # Check the response the user inputted.
     17 if [ "$response" != "${response#[Yy]}" ] || [ "$response" = "" ]; then
     18 	# Check if the brew command already exist. 
     19 	if command -v brew &>/dev/null; then
     20 		echo "Homebrew is already installed."
     21 	else 
     22 		echo "Installing Homebrew..."
     23 		/usr/bin/ruby -e \
     24 		"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
     25 
     26 		echo "Adding Homebrew to path..."
     27 	    export PATH="/usr/local/bin:$PATH"
     28 
     29 		echo "Installing Brewfile packages..."
     30 		brew bundle --file $FILE/Brewfile
     31 
     32 		echo "Checking for updates..."
     33 		brew update
     34 	fi
     35 fi
     36 
     37 echo "Exiting."