1
0
mirror of https://github.com/danbee/mac-setup synced 2025-03-04 08:39:10 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
52ed8fe591
These should be extras 2019-04-15 22:15:53 -04:00
2d794282de
Better readme formatting 2019-04-15 22:12:43 -04:00
7b7d61ca01
Improve keypress wait 2019-04-15 22:09:37 -04:00
b1c5cf8808
Fix keygen 2019-04-15 22:02:18 -04:00
abad92f2d9
We need Homebrew before we get git
Because installing Homebrew installs the Xcode command line tools.
2019-04-15 21:58:31 -04:00
25447c2c60
Only install Homebrew if it's not already installed 2019-04-15 21:44:53 -04:00
532a08598d
Refactor all the things! 2019-04-15 21:37:08 -04:00
8 changed files with 99 additions and 53 deletions

View File

@ -1,10 +1,11 @@
tap "thoughtbot/formulae"
tap "heroku/brew"
brew "asdf"
brew "direnv"
brew "git"
brew "heroku"
brew "imagemagick"
brew "mas"
brew "mackup"
brew "postgresql"
brew "pv"
brew "ripgrep"
@ -20,30 +21,16 @@ brew "zsh"
cask "1password"
cask "acorn"
cask "choosy"
cask "colorpicker-skalacolor"
cask "dropbox"
cask "fantastical"
cask "firefox"
cask "google-chrome"
cask "imagealpha"
cask "imageoptim"
cask "istat-menus"
cask "iterm2"
cask "ivolume"
cask "iterm2-nightly"
cask "kaleidoscope"
cask "macvim"
cask "mplayerx"
cask "mpv"
cask "phantomjs"
cask "sequel-pro"
cask "skype"
cask "spotify"
cask "superduper"
cask "textmate"
cask "vmware-fusion"
cask "vlc"
tap "caskroom/fonts"
cask "font-vollkorn"
cask "font-source-code-pro"
cask "font-source-sans-pro"

View File

@ -1,11 +1,11 @@
## Mac Setup
Script and Brewfiles to setup a Mac for development.
Script and Brewfile to setup a Mac for development.
## Instructions
Full Xcode install is required to compile MacVim.
1. Run the setup script with:
1. Install Xcode with `xcode-select --install`. Select "Get Xcode".
2. Run the setup script with `curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/setup.sh | sh`
```sh
curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/setup.sh | sh`
```

24
lib/dotfiles.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
cd "$HOME"
if [ $SHELL != $(which zsh) ]; then
chsh -s $(which zsh)
fi
if [ ! -d "$HOME/dotfiles" ]; then
git clone git@github.com:thoughtbot/dotfiles.git
else
cd "$HOME/dotfiles"
git pull
cd -
fi
if [ ! -d "$HOME/dotfiles-local" ]; then
git clone git@github.com:danbee/dotfiles-local.git
else
cd "$HOME/dotfiles-local"
git pull
cd -
fi
env RCRC="$HOME/dotfiles/rcrc" rcup

8
lib/git_author.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
DOTFILES="$HOME/dotfiles-local"
if [ ! -f "$DOTFILES/gitconfig.author" ]; then
cp "$DOTFILES//gitconfig.author.example" "$DOTFILES/gitconfig.author"
vim "$DOTFILES/gitconfig.author"
fi

1
lib/homebrew.sh Normal file
View File

@ -0,0 +1 @@
#!/bin/sh

9
lib/mas.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# mas install 13764025890
mas install 1107421413
mas install 403504866
mas install 1278508951
mas install 497799835
mas install 1179623856
mas install 1082624744

19
mas.sh
View File

@ -1,19 +0,0 @@
#!/bin/sh
mas install 904280696
mas install 13764025890
mas install 1084713122
mas install 1107421413
mas install 409183694
mas install 403504866
mas install 1278508951
mas install 918858936
mas install 530458789
mas install 734335183
mas install 409203825
mas install 497799835
mas install 409201541
mas install 1179623856
mas install 1082624744
mas install 1225570693
mas install 924726344

View File

@ -1,23 +1,59 @@
#!/bin/sh
MAC_SETUP_DIR="$HOME/mac-setup"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
BOLD="\033[1m"
WHITE="\033[0;37m"
YELLOW="\033[1;33m"
GREEN="\033[1;32m"
NC="\033[0m"
# We want to be in the user home directory.
cd ~
step() {
echo "${YELLOW} ${WHITE}${BOLD}$1${NC} ${YELLOW}${NC}"
}
# Get Brewfiles.
echo 'Downloading...'
curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/Brewfile > ~/Brewfile
curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/mas.sh > ~/mas.sh
chmod +x ~/mas.sh
# Generate an SSH key if one does not already exist
if [ ! -f "$HOME/.ssh/id_ed25519.pub" ]; then
step "Generating SSH key"
ssh-keygen -t ed25519 -f "$HOME/.ssh/id_ed25519"
echo "Copy and paste the public portion of the key (below) to GitHub"
echo "============ Public key ============="
cat ~/.ssh/id_ed25519.pub
echo "====================================="
read -r -p "Press any key to continue... " -n 1
fi
# Install Homebrew
step "Installing Homebrew"
if ! type brew > /dev/null; then
/usr/bin/ruby -e \
"$(curl \
-fsSL \
https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Clone setup repo
if [ ! -d "$MAC_SETUP_DIR" ]; then
git clone git@github.com:danbee/mac-setup.git "$HOME/mac-setup"
else
cd "$MAC_SETUP_DIR"
git pull
cd -
fi
# Install brew bundles
echo 'Installing Homebrew bundle...'
brew bundle
step "Installing Homebrew bundle"
brew bundle --file="$MAC_SETUP_DIR/Brewfile"
# Install Mac App Store apps
echo 'Installing App Store apps'
~/mas.sh
step "Installing App Store apps"
"$MAC_SETUP_DIR/lib/mas.sh"
echo 'Done!'
# Install dotfiles
step "Installing dotfiles"
"$MAC_SETUP_DIR/lib/dotfiles.sh"
# Setup git author
step "Set git author"
"$MAC_SETUP_DIR/lib/git_author.sh"
echo "${GREEN}${WHITE}${BOLD}Done!${NC} 🎉"