Bootstap script.

This commit is contained in:
Artem Sapegin 2012-10-23 12:47:00 +04:00
parent 580145edbc
commit 404d8fb60d
12 changed files with 65 additions and 24 deletions

View File

@ -11,7 +11,7 @@ INSTALLER_DIR=`mktemp -d`
#
# @param $1 URL
# @param $2 File name
function download_installer {
function download_installer {`
echo "Downloading $1/$2..."
cd "$INSTALLER_DIR"
curl -LO "$1/$2"
@ -24,9 +24,7 @@ function download_installer {
# @param Application name
function install_app {
echo "Installing $2.app..."
cp -a "$1/$2.app" "$HOME/Applications/"
#find "$1" -type d -name "*.app" -exec sh -c 'cp -a "$0" $HOME/Applications/' {} ';'
#find "$1" -type d -name "*.app" -exec sh -c 'cp -a "$0" $HOME/Applications/' {} ';'
cp -a "$1/$2.app" "/Applications/"
}
# Installs an application via a DMG file

View File

@ -1,5 +1,8 @@
#!/bin/bash
# Installs Chrome and makes it default browser
source "$HOME/dotfiles/includes/installer.sh"

View File

@ -1,6 +1,8 @@
#!/bin/bash
# Installs Bash 4 and registers it as a default shell
brew install bash
grep '/usr/local/bin/bash' /etc/shells >/dev/null 2>&1 && sudo bash -c "echo /usr/local/bin/bash >> /etc/shells"
chsh -s /usr/local/bin/bash $USER

13
setup/bootstrap.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# New Mac bootstrap
. brew.sh
. npm.sh
. bash.sh
. consolas.sh
. imgo.sh
. osx.sh
. sublime-settings.sh
. sublime-packages.sh
. apps.sh

View File

@ -1,5 +1,7 @@
#!/bin/bash
# Based on https://github.com/mathiasbynens/dotfiles/blob/master/.brew
# Installs Homebrew with some formulaes
# Setup Homebrew
command -v brew >/dev/null 2>&1 || ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
@ -15,9 +17,6 @@ brew install coreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils
# Install wget with IRI support
#brew install wget --enable-iri
# Install more recent versions of some OS X tools
brew tap homebrew/dupes
brew install homebrew/dupes/grep
@ -28,7 +27,7 @@ brew install homebrew/dupes/grep
brew install git
brew install git-extras
brew install unrar
#brew install node
brew install node
# Remove outdated versions from the cellar
brew cleanup

View File

@ -1,7 +1,11 @@
#!/bin/bash
# Installs Consolas font
#
# Press "Intall font" button when font dialog opens
# Based on http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
brew install cabextract
TMPDIR=`mktemp -d` && {
cd $TMPDIR

View File

@ -1,6 +1,9 @@
#!/bin/bash
# Installs imgo CLI image optimizer
# https://github.com/imgo/imgo
brew install exiftool imagemagick optipng libjpeg gifsicle
formulas='pngout.rb defluff.rb cryopng.rb imgo.rb'

10
setup/npm.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# Installs Node.js and some NPM packages
brew install node
npm install -g grunt
npm install -g jshint
npm install -g bower

View File

@ -1,5 +1,6 @@
#!/bin/bash
# Sane OSX defaults
# ~/.osx — http://mths.be/osx
COMPUTERNAME='Mac'
@ -562,8 +563,7 @@ sudo pmset -c panicrestart 15
###############################################################################
for app in "Address Book" "Calendar" "Contacts" "Dashboard" "Dock" "Finder" \
"Mail" "Safari" "SizeUp" "SystemUIServer" "Terminal" "Transmission" \
"Twitter" "iCal" "iTunes"; do
"Mail" "Safari" "SystemUIServer" "Terminal" "iCal" "iTunes"; do
killall "$app" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

View File

@ -1,32 +1,35 @@
#!/bin/bash
# Installs/updates Sublime packages
#
# 1. Installs Package Control (all plugins listed in `Package Control.sublime-settings` will be installed after Sublime restarts).
# 2. Installs some packages from GitHub.
if [ `uname` == 'Darwin' ]; then
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages
DIR=~/Library/Application\ Support/Sublime\ Text\ 2/Packages
else
cd ~/AppData/Roaming/Sublime\ Text\ 2/Installed\ Packages
DIR=~/AppData/Roaming/Sublime\ Text\ 2/Packages
fi
[ ! -d "$DIR" ] && mkdir -p "$DIR"
cd "$DIR"
#
# Package Control
#
[ ! -f Package\ Control.sublime-package ] && curl -o Package\ Control.sublime-package http://sublime.wbond.net/Package%20Control.sublime-package
[ ! -d Package\ Control ] && [ ! -f Package\ Control.sublime-package ] && curl -o Package\ Control.sublime-package http://sublime.wbond.net/Package%20Control.sublime-package
#
# GitHub
#
cd ../Packages
# Hayaku Bundle
if [ -d ./hayaku ]; then
echo "Updating Hayaku Bundle..."
cd hayaku
cd "$DIR/hayaku"
git pull
git submodule update
cd ..

View File

@ -1,12 +1,17 @@
#!/bin/bash
# Enables Sublime settings syncronization
if [ `uname` == 'Darwin' ]; then
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
DIR=~/Library/Application\ Support/Sublime\ Text\ 2
else
cd ~/AppData/Roaming/Sublime\ Text\ 2/Packages
DIR=~/AppData/Roaming/Sublime\ Text\ 2
fi
[ ! -d ../Packages.bak ] && mkdir ../Packages.bak
mv User ../Packages.bak/User
ln -s ~/dotfiles/sublime/User User
[ ! -d "$DIR" ] && mkdir -p "$DIR/Packages"
if [ -d "$DIR/Packages/User" ]; then
mkdir "$DIR/Packages.bak"
mv "$DIR/Packages/User" "$DIR/Packages.bak/User"
fi
ln -s ~/dotfiles/sublime/User "$DIR/Packages/User"

View File

@ -20,6 +20,7 @@
"save_on_focus_lost": true,
"tab_completion": true,
"detect_slow_plugins": false,
"scroll_past_end": true,
"theme": "Soda Light.sublime-theme",
// Hayaku