Last active
September 7, 2016 21:03
-
-
Save mnem/6560977 to your computer and use it in GitHub Desktop.
Things to install on a fresh Mac: bash <(curl -fsSL https://gist.github.com/mnem/6560977/raw/install_all_the_things.sh)
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
#!/usr/bin/env bash | |
function execute_after_confirm { | |
read -p "$1 ($2) ? [y/n] " -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
shift | |
for var in "$@" | |
do | |
echo $var | |
eval $var | |
return_code=$? | |
if [[ $return_code != 0 ]] ; then | |
exit $return_code | |
fi | |
done | |
fi | |
} | |
execute_after_confirm \ | |
'Generate SSH keys' \ | |
"ssh-keygen -t rsa -C \"`uname -n`\"" \ | |
'pbcopy < ~/.ssh/id_rsa.pub ##### Copied key to clipboard #####' | |
execute_after_confirm \ | |
'Install Homebrew' \ | |
'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"' \ | |
'brew doctor' | |
ALL_THE_THINGS=\ | |
'git'\ | |
' tmux'\ | |
' the_silver_searcher'\ | |
' grc'\ | |
' cmake'\ | |
' nmap'\ | |
' figlet'\ | |
' gibo'\ | |
' parallel'\ | |
' uncrustify'\ | |
' toilet'\ | |
' tree'\ | |
' htop'\ | |
' chruby'\ | |
' ruby-install' | |
execute_after_confirm \ | |
'Install useful packages' \ | |
"brew install $ALL_THE_THINGS" | |
RUBY_VERSION="2.2.3" | |
execute_after_confirm \ | |
"Install Ruby" \ | |
"ruby-install ruby $RUBY_VERSION" \ | |
'source /usr/local/share/chruby/chruby.sh' \ | |
"chruby $RUBY_VERSION" | |
execute_after_confirm \ | |
"Install Homesick" \ | |
'gem install homesick' \ | |
'homesick clone [email protected]:mnem/dotty_bash.git' \ | |
'homesick symlink dotty_bash' \ | |
'homesick clone [email protected]:mnem/dotty_tmux.git' \ | |
'homesick symlink dotty_tmux' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One line execute:
Also, why it's a terrible idea to execute scripts like this: