Skip to content

Commit

Permalink
feat(editors): use brew cask to install atom, visual studio code, sub…
Browse files Browse the repository at this point in the history
…lime, and textmate (macOS only)
  • Loading branch information
Deavon M. McCaffery committed Aug 19, 2016
1 parent f863b54 commit e15dabc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
14 changes: 13 additions & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,25 @@ if [ "$(uname)" == "Darwin" ]; then
brew upgrade ${pkg} 1>/dev/null 2>&1
else
echo "Installing $pkg..."
brew install $pkg
brew install ${pkg}
fi
done

LOCAL_PREFIX=$(brew --prefix)

git config --system credential.helper osxkeychain

for app in atom visual-studio-code sublime-text textmate; do
if brew cask list -1 | grep -q "^${app}\$"; then
echo "Upgrading $app..."
brew cask update ${app}
else
echo "Installing $app..."
brew cask install ${app}
fi
done

git config --system core.editor "atom --wait"
fi

git config --system color.ui true
Expand Down
28 changes: 0 additions & 28 deletions src/scripts/Darwin/launch-editors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,6 @@ function launch-code() {
fi
}

function launch-sublime() {
if test -f /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl; then
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl $*
else
echo "SublimeText is not installed... please install it from http://sublimetext.com"
fi
}

function launch-atom() {
if test -f /Applications/Atom.app/Contents/Resources/app/atom.sh; then
/Applications/Atom.app/Contents/Resources/app/atom.sh $*
else
echo "Atom is not installed... please install it from http://atom.io"
fi
}

function atom() {
launch-atom $@
}

function code() {
launch-code $@
}

function sublime() {
launch-sublime $@
}

function subl() {
launch-sublime $@
}
10 changes: 9 additions & 1 deletion src/scripts/set-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ for f in $LOCAL_PREFIX/etc/bash_completion.d/*; do
source $f
done

if type gulp; then
if type gulp 1>/dev/null 2>&1; then
eval "$(gulp --completion=bash)"
fi

if type grunt 1>/dev/null 2>&1; then
eval "$(grunt --completion=bash)"
fi

if type npm 1>/dev/null 2>&1; then
eval "$(npm completion)"
fi

function set-prompt() {
# set the window title
echo -ne "\033]0;${USER}@${HOSTNAME%%.*} ${PWD}\007"
Expand Down

0 comments on commit e15dabc

Please sign in to comment.