From 5ba7e2dc3a65b9c95642ddd9bf1b2856892f3c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=A4rcker?= Date: Sat, 3 Mar 2018 22:52:32 +0100 Subject: [PATCH] install.sh: Make more robust install.sh attempts to replace PRISM_DIR=... with the actual PRISM directory in the startup scripts contained in bin/ using a call to sed. On MacOS, the system sed fails with 'RE error: illegal byte sequence' for binary files, such as the .DS_Store files created by the Finder. So, we exclude all files starting with a dot (.*) as well. Additionally, we use `-iname` instead of `-name` in the find command for the matches against '*.bat' and 'ngprism' to match insensitive to the case of the filename. [adapted by @kleinj from PR #59] --- prism/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prism/install.sh b/prism/install.sh index 24782a68..09bbbeb7 100755 --- a/prism/install.sh +++ b/prism/install.sh @@ -17,7 +17,12 @@ if [ ! "$1" = "silent" ] ; then echo "Installing PRISM (directory=$PRISM_DIR)" fi TEMP_FILE=tmp -FILES_TO_CHANGE=`find bin -maxdepth 1 ! -type d ! -name '*.bat' ! -name ngprism` +# Search for the scripts that should be changed +# We exclude: +# - Windows .BAT files +# - the ngprism binary +# - hidden files (starting with a dot, e.g., the .DS_Store files from MacOS) +FILES_TO_CHANGE=`find bin -maxdepth 1 ! -type d ! -iname '*.bat' ! -iname ngprism ! -name '.*'` for FILE_TO_CHANGE in $FILES_TO_CHANGE do if [ -f "$PRISM_DIR"/$FILE_TO_CHANGE ]; then