diff --git a/installer/src/install.sh b/installer/src/install.sh index 589f566..275de0e 100755 --- a/installer/src/install.sh +++ b/installer/src/install.sh @@ -59,7 +59,18 @@ function do_install { if [ -f $1/hotfix ]; then debug "Hotfix already installed, or at least something was found matching $1/hotfix" - debug "Nothing will be copied." + question "Do you want to overwrite $1/hotfix?" + echo -n " Overwrite? [y/N]: " + read CONFIRMATION + case "$CONFIRMATION" in + "y"|"Y"|"yes") + debug "Installing into $1" + cp hotfix $1/hotfix + ;; + *) + debug "Not overwriting $1/hotfix" + ;; + esac else debug "Installing into $1" cp hotfix $1/hotfix @@ -101,9 +112,9 @@ fi if [ ! -d $INSTALL_PATH ]; then question "The directory $INSTALL_PATH does not exist. Do you want to create it?" echo -n " Create directory? [Y/n]: " - read $CONFIRMATION + read CONFIRMATION case "$CONFIRMATION" in - "n|N|no") + "n"|"N"|"no") error "Directory not created. Aborting." exit ;; diff --git a/src/Hotfix/HotfixLoader.php b/src/Hotfix/HotfixLoader.php index d959eb3..d33a0fe 100644 --- a/src/Hotfix/HotfixLoader.php +++ b/src/Hotfix/HotfixLoader.php @@ -14,10 +14,15 @@ class HotfixLoader public static function load($uri) { // First, check if this is a valid URL or filename - if ((strpos($uri,"://")!==false) || (file_exists($uri))) { + if (strpos($uri,"://")!==false) { return self::loadFromUri($uri); } + $real = realpath($uri); + if ($real && file_exists($real)) { + return self::loadFromUri($real); + } + if (strpos($uri,":")!==false) { list($prefix,$id) = explode(":",$uri,2); } else {