dotfiles/setup/sublime-packages.sh

40 lines
889 B
Bash
Raw Normal View History

2012-10-16 12:17:12 +00:00
#!/bin/bash
2012-10-23 08:47:00 +00:00
2012-10-16 12:11:28 +00:00
# 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.
2012-10-15 13:20:56 +00:00
2012-10-23 08:47:00 +00:00
2012-10-15 13:20:56 +00:00
if [ `uname` == 'Darwin' ]; then
2012-10-23 08:47:00 +00:00
DIR=~/Library/Application\ Support/Sublime\ Text\ 2/Packages
2012-10-15 13:20:56 +00:00
else
2012-10-23 08:47:00 +00:00
DIR=~/AppData/Roaming/Sublime\ Text\ 2/Packages
2012-10-15 13:20:56 +00:00
fi
2012-10-23 08:47:00 +00:00
[ ! -d "$DIR" ] && mkdir -p "$DIR"
cd "$DIR"
2012-10-15 13:20:56 +00:00
2012-10-16 12:11:28 +00:00
#
# Package Control
#
2012-10-23 08:47:00 +00:00
[ ! -d Package\ Control ] && [ ! -f Package\ Control.sublime-package ] && curl -o Package\ Control.sublime-package http://sublime.wbond.net/Package%20Control.sublime-package
2012-10-16 12:11:28 +00:00
#
# GitHub
#
2012-10-15 13:20:56 +00:00
# Hayaku Bundle
if [ -d ./hayaku ]; then
echo "Updating Hayaku Bundle..."
2012-10-23 08:47:00 +00:00
cd "$DIR/hayaku"
2012-10-15 13:20:56 +00:00
git pull
git submodule update
cd ..
else
echo "Installing Hayaku Bundle..."
git clone -b sublime-master git://github.com/hayaku/hayaku.git --recursive
fi