-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.sh
35 lines (30 loc) · 1.24 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Installs rbbedit into /usr/local/bin
# Installer ideas from https://github.com/beautifulcode/ssh-copy-id-for-OSX
if [[ $(id -u) != 0 ]]; then
if command -v sudo >/dev/null 2>&1; then
SUDO="sudo"
else
echo >&2 "Requires sudo but it's not installed. Aborting."
exit 1
fi
fi
if [ ! -z $RBBEDIT_INSTALL_PATH ]; then
rbbedit_path=$RBBEDIT_INSTALL_PATH
else
rbbedit_path="/usr/local/bin/rbbedit"
fi
install_base=`basename $rbbedit_path`
install_path=`dirname $rbbedit_path`
if git ls-files >& /dev/null && [[ -f rbbedit ]]; then
$SUDO cp rbbedit $rbbedit_path || { echo "Failed to install $install_base into $install_path"; exit 1; }
else
# $SUDO wget --no-check-certificate -O $rbbedit_path https://raw.githubusercontent.com/cngarrison/rbbedit/master/rbbedit || { echo "Failed to install $install_base into $install_path"; exit 1; }
$SUDO curl -L --insecure -o $rbbedit_path https://raw.githubusercontent.com/cngarrison/rbbedit/master/rbbedit || { echo "Failed to install $install_base into $install_path"; exit 1; }
$SUDO chmod +x $rbbedit_path || { echo "Failed to chmod rbbedit at $rbbedit_path"; exit 1; }
fi
echo "Installed $install_base into $install_path"; exit 0;
# Local Variables:
# tab-width: 3
# x-auto-expand-tabs: true
# End: