Browse Source

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]
master
Steffen Märcker 8 years ago
committed by Joachim Klein
parent
commit
5ba7e2dc3a
  1. 7
      prism/install.sh

7
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

Loading…
Cancel
Save