-
Notifications
You must be signed in to change notification settings - Fork 3
/
nuts-dev
executable file
·78 lines (68 loc) · 2.39 KB
/
nuts-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
## _ __ __
## / | / /_ __/ /______
## / |/ / / / / __/ ___/
## / /| / /_/ / /_(__ )
## /_/ |_/\\__,_/\\__/____/ shell script
##
## do not edit this file, it will regenerated each time you call build-web-site
##
## this script is used in a nuts development environment only!
## this script is used to call nuts using the current development version
## of nuts. It uses actually '~/.m2/repository' repository, so you need to call 'mvn install'
## for it to work properly.
## if the very first argument is '--debug' nuts will run nuts in debug mode (-agentlib:jdwp)
## with suspend mode and is useful if you want to debug nuts itself.
## In the case you are debugging an application called by nuts
## you can simply call 'nuts ---jdb your-application' (Please note the 3 dashes preceding jdb)
##
NUTS_VERSION=0.8.4
NUTS_JAR=~/.m2/repository/net/thevpc/nuts/nuts/$NUTS_VERSION/nuts-$NUTS_VERSION.jar
if [ x"$NUTS_VERSION" = "x" ] ; then
echo "you must call 'nuts nsh build-website.nsh' first to update NUTS_VERSION"
exit 0
fi
## Please update this path to point to your valid java 8 home, but
## DO NOT commit your changes to GIT for this file !!
#NUTS_JAVA_HOME='';
NUTS_JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
base=$(dirname $0)
if [ x"$1" = x"--debug" ] ; then
NUTS_DEBUG_ARG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
elif [[ x"$1" = x"--debug="* ]] ; then
sub=${1:8}
sub="${sub},"
d_port=5005
d_enable="true"
d_suspend="y"
subArray=$(echo $sub | tr "," "\n")
for curr in $subArray
do
if [ ! -z "${curr##*[!0-9]*}" ] ; then
d_port=$curr
elif [[ x"$curr" = 'xno' ]] ; then
d_enable="false"
elif [[ x"$curr" = 'xsuspend' ]] ; then
d_suspend="y"
elif [[ x"$curr" = 'x!suspend' ]] ; then
d_suspend="n"
elif [[ x"$curr" = 'xs' ]] ; then
d_suspend="y"
elif [[ x"$curr" = 'x!s' ]] ; then
d_suspend="n"
else
echo $curr is unsupported
fi
done
if [[ x$d_enable = x'true' ]] ; then
NUTS_DEBUG_ARG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=$d_suspend,address=$d_port"
fi
#echo $sub
fi
JAVA_CMD='java'
if [ x"$NUTS_JAVA_HOME" != "x" ] ; then
JAVA_CMD="$NUTS_JAVA_HOME/bin/java";
elif [ x"${JAVA_HOME}" != "x" ] ; then
JAVA_CMD="${JAVA_HOME}/bin/java";
fi
$JAVA_CMD $NUTS_DEBUG_ARG -jar "$NUTS_JAR" -w development "$@"