Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell style fix #5

Merged
2 commits merged into from Feb 7, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 24 additions & 20 deletions bootstrap-osx.sh
@@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh


if [ -d /Applications/Sublime\ Text\ 2.app/ ] APP_DIR="/Applications/Sublime Text 2.app"
SUBLIME_DIR="$HOME/Library/Application Support/Sublime Text 2"

if [ -d "$APP_DIR" ]
then then
echo 'Sublime Text 2 application found.' echo 'Sublime Text 2 application found.'
else else
Expand All @@ -10,48 +13,48 @@ else
fi fi


# Add `subl` terminal command # Add `subl` terminal command
if [ `which subl` ] command -v subl > /dev/null
if [ $? -eq 0 ]
then then
echo '`subl` terminal command already installed' echo "Terminal command 'subl' already installed"
else else
if [ -d $HOME/.bin ] if [ -d "$HOME/.bin" ]
then
echo "Adding terminal command 'subl' into ~/.bin"
ln -s "$APP_DIR/Contents/SharedSupport/bin/subl" "$HOME/.bin/subl"
elif [ -d "$HOME/bin" ]
then then
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl $HOME/.bin/subl echo "Adding terminal command 'subl' into ~/bin"
ln -s "$APP_DIR/Contents/SharedSupport/bin/subl" "$HOME/bin/subl"
else else
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl echo "Adding terminal command 'subl' into /usr/local/bin"
ln -s "$APP_DIR/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
fi fi
fi fi


# Install package control # Install package control
# http://wbond.net/sublime_packages/package_control/installation # http://wbond.net/sublime_packages/package_control/installation


if [ -d $HOME/Library/Application\ Support/Sublime\ Text\ 2/ ] if [ -d "$SUBLIME_DIR" ]
then then
echo 'Config directory found.' echo 'Config directory found.'
else else
echo 'Creating config directory' echo 'Creating config directory'
subl -b && sleep '0.5' && osascript -e 'tell application "Sublime Text 2" to quit' subl --background && sleep '0.5' && osascript -e 'tell application "Sublime Text 2" to quit'
fi fi


cd $HOME/Library/Application\ Support/Sublime\ Text\ 2/ if [ -f "$SUBLIME_DIR/Installed Packages/Package Control.sublime-package" ]

if [ -f Installed\ Packages/Package\ Control.sublime-package ]
then then
echo 'Package Control already installed.' echo 'Package Control already installed.'
else else
echo 'Downloading Package Control' echo 'Downloading Package Control'
curl -s 'http://sublime.wbond.net/Package%20Control.sublime-package' > Installed\ Packages/Package\ Control.sublime-package curl --silent --show-error 'http://sublime.wbond.net/Package%20Control.sublime-package' --output "$SUBLIME_DIR/Installed Packages/Package Control.sublime-package"
fi fi


cd -

echo 'Add default packages and configs...' echo 'Add default packages and configs...'
cp -f "settings/*" "$SUBLIME_DIR/Packages/User/"


cp -f settings/Preferences.sublime-settings $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/ echo | subl --wait <<TXT
cp -f settings/Package\ Control.sublime-settings $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/
cp -f settings/Default\ \(OSX\).sublime-keymap $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/

echo | subl -w <<TXT
# Almost done # Almost done


Now Sublime Text 2 installing packages and "Soda Theme" Now Sublime Text 2 installing packages and "Soda Theme"
Expand All @@ -66,7 +69,8 @@ When it's done (you should see 'Package Control: No updated packages' line)
please close Sublime Text 2 (cmd-q). ST2 will restart automatically. please close Sublime Text 2 (cmd-q). ST2 will restart automatically.


-- --
nicck https://github.com/fs/sublime-bootstrap
TXT TXT


subl ./ subl ./
echo 'Done.'