mirror of
https://github.com/danbee/mac-setup
synced 2025-03-04 08:39:10 +00:00
Refactor all the things!
This commit is contained in:
parent
30be66abd7
commit
532a08598d
15
Brewfile
15
Brewfile
@ -1,7 +1,9 @@
|
|||||||
tap "thoughtbot/formulae"
|
tap "thoughtbot/formulae"
|
||||||
|
tap "heroku/brew"
|
||||||
brew "asdf"
|
brew "asdf"
|
||||||
brew "direnv"
|
brew "direnv"
|
||||||
brew "git"
|
brew "git"
|
||||||
|
brew "heroku"
|
||||||
brew "imagemagick"
|
brew "imagemagick"
|
||||||
brew "mas"
|
brew "mas"
|
||||||
brew "mackup"
|
brew "mackup"
|
||||||
@ -20,30 +22,19 @@ brew "zsh"
|
|||||||
cask "1password"
|
cask "1password"
|
||||||
cask "acorn"
|
cask "acorn"
|
||||||
cask "choosy"
|
cask "choosy"
|
||||||
cask "colorpicker-skalacolor"
|
|
||||||
cask "dropbox"
|
cask "dropbox"
|
||||||
cask "fantastical"
|
|
||||||
cask "firefox"
|
cask "firefox"
|
||||||
cask "google-chrome"
|
cask "google-chrome"
|
||||||
cask "imagealpha"
|
cask "imagealpha"
|
||||||
cask "imageoptim"
|
cask "imageoptim"
|
||||||
cask "istat-menus"
|
cask "iterm2-nightly"
|
||||||
cask "iterm2"
|
|
||||||
cask "ivolume"
|
|
||||||
cask "kaleidoscope"
|
cask "kaleidoscope"
|
||||||
cask "macvim"
|
cask "macvim"
|
||||||
cask "mplayerx"
|
|
||||||
cask "mpv"
|
|
||||||
cask "phantomjs"
|
cask "phantomjs"
|
||||||
cask "sequel-pro"
|
cask "sequel-pro"
|
||||||
cask "skype"
|
|
||||||
cask "spotify"
|
|
||||||
cask "superduper"
|
|
||||||
cask "textmate"
|
cask "textmate"
|
||||||
cask "vmware-fusion"
|
cask "vmware-fusion"
|
||||||
cask "vlc"
|
|
||||||
|
|
||||||
tap "caskroom/fonts"
|
|
||||||
cask "font-vollkorn"
|
cask "font-vollkorn"
|
||||||
cask "font-source-code-pro"
|
cask "font-source-code-pro"
|
||||||
cask "font-source-sans-pro"
|
cask "font-source-sans-pro"
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
## Mac Setup
|
## Mac Setup
|
||||||
|
|
||||||
Script and Brewfiles to setup a Mac for development.
|
Script and Brewfile to setup a Mac for development.
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
|
|
||||||
Full Xcode install is required to compile MacVim.
|
1. Run the setup script with `curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/setup.sh | sh`
|
||||||
|
|
||||||
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`
|
|
||||||
|
|||||||
24
lib/dotfiles.sh
Executable file
24
lib/dotfiles.sh
Executable 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
8
lib/git_author.sh
Executable 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
|
||||||
3
lib/homebrew.sh
Executable file
3
lib/homebrew.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
9
lib/mas.sh
Executable file
9
lib/mas.sh
Executable 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
19
mas.sh
@ -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
|
|
||||||
58
setup.sh
58
setup.sh
@ -1,23 +1,55 @@
|
|||||||
#!/bin/sh
|
#!/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.
|
step() {
|
||||||
cd ~
|
echo "${YELLOW}❯❯❯ ${WHITE}${BOLD}$1${NC} ${YELLOW}❮❮❮${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
# Get Brewfiles.
|
# Generate an SSH key if one does not already exist
|
||||||
echo 'Downloading...'
|
if [ ! -f "$HOME/.ssh/id_ed25519.pub" ]; then
|
||||||
curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/Brewfile > ~/Brewfile
|
step "Generating SSH key"
|
||||||
curl -s https://raw.githubusercontent.com/danbee/mac-setup/master/mas.sh > ~/mas.sh
|
ssh-keygen -t ed25519 -f "$HOME/.ssh/id_ed25519"
|
||||||
chmod +x ~/mas.sh
|
echo "Copy and paste the public portion of the key (below) to GitHub"
|
||||||
|
echo "and press a key when done."
|
||||||
|
echo "=========== Public key =============="
|
||||||
|
cat ~/.ssh/id_ed25519.pub
|
||||||
|
echo "====================================="
|
||||||
|
read -n 1 -s
|
||||||
|
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 Homebrew
|
||||||
|
step "Installing Homebrew"
|
||||||
|
"$MAC_SETUP_DIR/lib/homebrew.sh"
|
||||||
|
|
||||||
# Install brew bundles
|
# Install brew bundles
|
||||||
echo 'Installing Homebrew bundle...'
|
step "Installing Homebrew bundle"
|
||||||
brew bundle
|
brew bundle --file="$MAC_SETUP_DIR/Brewfile"
|
||||||
|
|
||||||
# Install Mac App Store apps
|
# Install Mac App Store apps
|
||||||
echo 'Installing App Store apps'
|
step "Installing App Store apps"
|
||||||
~/mas.sh
|
"$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} 🎉"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user