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

Feature/implement install prefix #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ssh-copy-rsub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# Shell script to install rsub on the remove server so we can open shell scripts locally.
# Author: Leon Radley (http://github.com/leon)

if [ -z "$INSTALL_PREFIX" ] ; then
INSTALL_PREFIX="/usr/local/bin"
fi


URL="https://raw.github.com/textmate/rmate/master/bin/rmate"

if [ "$#" -gt 1 ] || [ "$1" = "-b" ] || [ "$1" = "--bash" ]; then
Expand All @@ -14,6 +19,9 @@ if [ "$#" -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then

cat <<EOF
Usage: $0 [--bash] [user@]machine
Environment:
INSTALL_PREFIX=$INSTALL_PREFIX


# Install Sublime Text plugin
https://github.com/henrikpersson/rsub
Expand All @@ -36,7 +44,7 @@ EOF
exit 1
fi

wget --quiet -O - "${URL}" | ssh ${1%:} 'umask 077; test -d /usr/local/bin || mkdir -p /usr/local/bin; cat > /usr/local/bin/rsub; chmod a+rx /usr/local/bin/rsub' || exit 1
wget --quiet -O - "${URL}" | ssh ${1%:} "umask 077; test -d $INSTALL_PREFIX || mkdir -p $INSTALL_PREFIX; cat > $INSTALL_PREFIX/rsub; chmod a+rx $INSTALL_PREFIX/rsub" || exit 1

cat <<EOF

Expand Down