From 17d2030d489196275b3c3e99737176e072db5fc0 Mon Sep 17 00:00:00 2001 From: Renato Silva Date: Mon, 13 Oct 2014 19:51:29 -0300 Subject: [PATCH] Allow installing to a location other than /usr/local/bin. --- install.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 183110e..f9a9170 100644 --- a/install.sh +++ b/install.sh @@ -1,13 +1,15 @@ #!/bin/bash from=$(dirname "$0") +where="${1:-/usr/local/bin}" +mkdir -p "$where" || exit if [[ "$1" != --remove ]]; then - cp -v "$from/easyoptions" /usr/local/bin - cp -v "$from/easyoptions.sh" /usr/local/bin - cp -v "$from/easyoptions.rb" /usr/local/bin + cp -v "$from/easyoptions" "$where" + cp -v "$from/easyoptions.sh" "$where" + cp -v "$from/easyoptions.rb" "$where" else - rm -vf /usr/local/bin/easyoptions - rm -vf /usr/local/bin/easyoptions.sh - rm -vf /usr/local/bin/easyoptions.rb + rm -vf "$where/easyoptions" + rm -vf "$where/easyoptions.sh" + rm -vf "$where/easyoptions.rb" fi