From f261e0ae7a93e7defef6920e8df692f34e029743 Mon Sep 17 00:00:00 2001 From: John Simon Date: Thu, 7 Mar 2013 15:31:05 -0500 Subject: [PATCH] Account for `install` not being present in MinGW --- install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 4e2cc9f..b4f9252 100755 --- a/install.sh +++ b/install.sh @@ -49,6 +49,13 @@ if [[ ${#} == 1 ]] && ([[ $1 = "-n" ]] || [[ $1 = "--dry-run" ]]); then set -- "-n" "--auto" fi +# `install` isn't supported on Windows +if which install; then + install="install -v -m 0755" +else + install="cp -r" +fi + # Command line parsing while true; do case "$1" in @@ -229,7 +236,7 @@ cp -v ./bin/autojump.bash "${destdir}etc/profile.d/" || exit 1 cp -v ./bin/autojump.zsh "${destdir}etc/profile.d/" || exit 1 mkdir -p "${destdir}${zshsharedir}" || exit 1 # TODO: remove unused _j function (2013.02.01_1348, ting) -install -v -m 0755 ./bin/_j "${destdir}${zshsharedir}" || exit 1 +${install} ./bin/_j "${destdir}${zshsharedir}" || exit 1 # MODIFY AUTOJUMP.SH FOR CUSTOM INSTALLS if [[ -z ${local} ]] && [[ -z ${global} ]]; then