summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/arara/arara.sh24
1 files changed, 16 insertions, 8 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/arara/arara.sh b/Build/source/texk/texlive/linked_scripts/arara/arara.sh
index 8f97643a72e..197228f4916 100755
--- a/Build/source/texk/texlive/linked_scripts/arara/arara.sh
+++ b/Build/source/texk/texlive/linked_scripts/arara/arara.sh
@@ -1,9 +1,17 @@
-#!/bin/bash
-kernel=`uname -s`
-if test "${kernel#*CYGWIN}" != "$kernel"
-then
- jarpath=`cygpath -w $(kpsewhich --progname=arara --format=texmfscripts arara.jar)`
-else
- jarpath=`kpsewhich --progname=arara --format=texmfscripts arara.jar`
+#!/bin/sh
+# Public domain. Originally written by Norbert Preining and Karl Berry, 2018.
+# Note from Paulo: this script provides better Cygwin support than our original
+# approach, so the team decided to use it as a proper wrapper for arara as well.
+
+scriptname=`basename "$0"`
+jar="$scriptname.jar"
+jarpath=`kpsewhich --progname="$scriptname" --format=texmfscripts "$jar"`
+
+kernel=`uname -s 2>/dev/null`
+if echo "$kernel" | grep CYGWIN >/dev/null; then
+ CYGWIN_ROOT=`cygpath -w /`
+ export CYGWIN_ROOT
+ jarpath=`cygpath -w "$jarpath"`
fi
-java -jar "$jarpath" "$@"
+
+exec java -jar "$jarpath" "$@"