Skip to content

Commit

Permalink
Update np script to set UTF-8 also in Java parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuhn committed Jan 21, 2021
1 parent 8d48cce commit 780c227
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/np
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,22 @@ cd $WORKINGDIR

NANOPUBJAR=$(find $SCRIPTDIR -maxdepth 1 -name "nanopub-*-jar-with-dependencies.jar" 2>/dev/null | sort -n | tail -1)

JAVAPARAMS="-Dsun.jnu.encoding=utf8 -Dfile.encoding=utf8"

if [ ! -z "$NANOPUBJAR" ]; then
exec java -jar $NANOPUBJAR "$@"
exec java $JAVAPARAMS -jar $NANOPUBJAR "$@"
fi

NANOPUBJAR=$(find /usr/share/java/ -maxdepth 1 -name "nanopub-*-jar-with-dependencies.jar" 2>/dev/null | sort -n | tail -1)

if [ ! -z "$NANOPUBJAR" ]; then
exec java -jar $NANOPUBJAR "$@"
exec java $JAVAPARAMS -jar $NANOPUBJAR "$@"
fi

NANOPUBJAR=$(find $PROJECTDIR/target/ -maxdepth 1 -name "nanopub-*-jar-with-dependencies.jar" 2>/dev/null | sort -n | tail -1)

if [ ! -z "$NANOPUBJAR" ]; then
exec java -jar $NANOPUBJAR "$@"
exec java $JAVAPARAMS -jar $NANOPUBJAR "$@"
fi

>&2 echo "No nanopub jar file found. Downloading it from the web..."
Expand All @@ -54,7 +56,7 @@ download-nanopub-jar
NANOPUBJAR=$(find $SCRIPTDIR -maxdepth 1 -name "nanopub-*-jar-with-dependencies.jar" 2>/dev/null | sort -n | tail -1)

if [ ! -z "$NANOPUBJAR" ]; then
exec java -jar $NANOPUBJAR "$@"
exec java $JAVAPARAMS -jar $NANOPUBJAR "$@"
fi

>&2 echo "ERROR: Failed to find or download nanopub jar file."
Expand Down

0 comments on commit 780c227

Please sign in to comment.