1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-04 15:24:12 +01:00
Arduino/build/linux/dist/arduino
Federico Fissore 85ae80b6f9 Introducing APP_DIR property. Allows the IDE to know its installation folder.
Also upgrading appbundler with a patched version: https://bitbucket.org/ffissore/appbundler It allows to know the current working directory
These two put together, we can now rely on APP_DIR when loading IDE resources while being sure current working directory is properly set, thus being much more friendly when run from CLI
Fixes #1493
2015-06-29 14:28:16 +02:00

38 lines
896 B
Bash
Executable File

#!/usr/bin/env bash
CURDIR=`pwd`
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
cd "$APPDIR"
for LIB in \
java/lib/rt.jar \
java/lib/tools.jar \
lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH
LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
export PATH="${APPDIR}/java/bin:${PATH}"
if [[ "$@" == *"--upload"* || "$@" == *"--verify"* || "$@" == *"--get-pref"* || "$@" == *"--install-board"* || "$@" == *"--install-library"* ]] ; then
SPLASH=""
else
SPLASH="-splash:./lib/splash.png"
fi
export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`
JAVA=java
if [ -x ./java/bin/java ]; then
JAVA=./java/bin/java
fi
$JAVA -DAPP_DIR="$APPDIR" -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir "$CURDIR" "$@"