1#!/bin/sh
2#
3#    Byobu - wrapper script for Mac OS X Application Launcher
4#    Copyright (C) 2012-2014 Dustin Kirkland <kirkland@byobu.org>
5#
6#    Authors: Dustin Kirkland <kirkland@byobu.org>
7#
8#    This program is free software: you can redistribute it and/or modify
9#    it under the terms of the GNU General Public License as published by
10#    the Free Software Foundation, version 3 of the License.
11#
12#    This program is distributed in the hope that it will be useful,
13#    but WITHOUT ANY WARRANTY; without even the implied warranty of
14#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#    GNU General Public License for more details.
16#
17#    You should have received a copy of the GNU General Public License
18#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20set -e
21
22if [ -x /Applications/iTerm.app/Contents/MacOS/iTerm ]; then
23	if [ -x /usr/local/bin/byobu ]; then
24		exec /Applications/iTerm.app/Contents/MacOS/iTerm /usr/local/bin/byobu
25	else
26		echo "You should install byobu into /usr/local" 1>&2
27		echo "HINT: brew install byobu" 1>&2
28		exit 1
29	fi
30else
31	echo "You should install iTerm2 into your /Applications" 1>&2
32		echo "HINT: http://www.iterm2.com" 1>&2
33	exit 1
34fi
35