Skip to content

Instantly share code, notes, and snippets.

@kumarks1122
Forked from cksachdev/dev-box.sh
Created August 19, 2019 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarks1122/11b643173fd60926cdfdb107663ba429 to your computer and use it in GitHub Desktop.
Save kumarks1122/11b643173fd60926cdfdb107663ba429 to your computer and use it in GitHub Desktop.
A simple bash script to install common dev tools

DevBox Instructions

  1. Move this folder to ~/Desktop
  2. Open terminal
  3. Navigate terminal to this folder: cd ~/Desktop/dev-box
  4. Run command: chmod +x ~/Desktop/dev-box/dev-box.sh to allow execution of the install script
  5. Run command: ./dev-box.sh to start the install script
  6. Let the process run. Near the end there are a few y/n (yes or no) prompts. Press key y/n to accept or not
  7. A folder called "Sites" will be created for you (within your user directory) to store project repos in
  8. After the script is finished you should be able to use the Mac search (top right) and see the following installed:
    • *Note: If any of these are missing run the command in parenthesis*
    • iTerm (brew cask install iterm)
    • Google Chrome (brew cask install google-chrome)
    • Slack (brew cask install slack)
    • Zeplin (brew cask install zeplin)
    • [Optional] Sublime (brew cask install sublime-text)
    • [Optional] VS Code (brew cask install visual-studio-code)
  9. Finally, you may need to restart your machine to ensure all updates take effect

What's included

  • Git command line tools (Xcode)
  • Homebrew package manager
  • NodeJS
  • Yarn (global)
  • Gulp (global)
  • Bower (global)
  • Multiple linter packages (global)
    • stylelint
    • eslint
    • prettier
    • stylelint-scss
    • stylelint-order
    • eslint-config-airbnb
    • eslint-config-prettier
    • eslint-config-airbnb-base
    • eslint-plugin-prettier
    • eslint-plugin-import
    • eslint-plugin-jsx-a11y
    • eslint-plugin-react
  • Multiple desktop applications
    • iTerm
    • Google Chrome
    • Slack
    • Zeplin
    • [Optional] Sublime Text
    • [Optional] VS Code
  • Oh My Zsh (Z Shell)
#!/usr/bin/env bash
# http://chetansachdev.com
# http://www.sirwinston.org/
# Install Xcode
# Install Homebrew
# Install Node
# Install Yarn
# Install Gulp
# Install Bower
# Install Linters
# Set OS defaults
# Install Desktop Applications
# Setup Projects Folder
# Install Oh-My-Zsh
# Ask for the administrator password upfront
sudo -v
echo "------------------------------"
echo "Initializing Development Workspace [×]"
# Update OS
# echo "Updating OSX. If this requires a restart, run the script again."
# # Install all available updates
# sudo softwareupdate -ia --verbose
# # Install only recommended available updates
# #sudo softwareupdate -ir --verbose
# Install Xcode Tools (Git)
echo "Installing Xcode Command Line Tools..."
# Install Xcode command line tools
xcode-select --install
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Make sure we’re using the latest Homebrew.
brew update
# Install Node & Global Packages
echo "Installing nvm..."
brew install nvm
mkdir ~/.nvm
chmod +x /usr/local/opt/nvm/nvm.sh
# https://dev.to/equiman/setup-macos-for-development-3kc2
echo "Installing Yarn..."
brew install yarn
echo "Installing Gulp..."
npm install -g gulp-cli
echo "Installing Bower..."
npm install -g bower
# Install Linters
echo "Installing Linters..."
npm install -g stylelint
npm install -g eslint
npm install -g prettier
npm install -g -D stylelint-scss
npm install -g -D stylelint-order
npm install -g -D eslint-config-airbnb
npm install -g -D eslint-config-prettier
npm install -g -D eslint-config-airbnb-base
npm install -g -D eslint-plugin-prettier
npm install -g -D eslint-plugin-import
npm install -g -D eslint-plugin-jsx-a11y
npm install -g -D eslint-plugin-react
# Set OS Defaults
echo "Setting OS Defaults..."
# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Disable smart quotes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 15
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# from https://msol.io/blog/tech/work-more-efficiently-on-your-mac-for-developers/
defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1
# Install Desktop Applications
# https://github.com/hackjutsu/Lepton for gist management
echo "Installing Lepton..."
brew cask install lepton
echo "Installing Karabiner Elements..."
brew cask install karabiner-elements
# https://kalis.me/setup-hyper-key-hammerspoon-macos/
brew cask install hammerspoon
# Switch between screens
# https://medium.com/thevelops-tech-blog/how-to-switch-focus-between-screens-in-macos-21c6f02883a6
# Ref https://dev.to/equiman/setup-macos-for-development-3kc2
echo "Install Sourcetree..."
brew cask install sourcetree
echo "Install Keka..."
brew cask install keka
echo "Installing iTerm..."
brew cask install iterm2
echo "Installing Google Chrome..."
brew cask install google-chrome
echo "Installing Slack..."
brew cask install slack
echo "Installing Zeplin..."
brew cask install zeplin
read -p "Would you like to download Sublime Text? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Installing Sublime Text..."
brew cask install sublime-text
fi;
read -p "Would you like to download VSCode? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Installing VSCode..."
brew cask install visual-studio-code
fi;
# Setup projects folder
echo "Creating 'Sites' Directory..."
cd ~
mkdir Sites
# Install Oh My Zsh
echo "Installing Oh My Zsh (Z shell)..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# from https://msol.io/blog/tech/work-more-efficiently-on-your-mac-for-developers/
mkdir ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
echo "Development Workspace Ready [✔]"
echo ""
echo "Be sure to checkout the README for more details on this script"
echo ""
echo "Restart your computer to ensure all updates take effect"
echo "------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment