summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlcockpit/tlcockpit.sh
blob: 1b2e8d9cb0479791fd70c19d692cb2cda77c2e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# Public domain. Originally written by Norbert Preining and Karl Berry, 2018-2019.

scriptname=`basename "$0"`
javaVersion=$(java -version 2>&1 | head -1)
case "$javaVersion" in
  *"1.8"*) jar="$scriptname-jdk8".jar ;;
  *) jar="$scriptname.jar" ;;
esac
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

exec java -jar "$jarpath" "$@"