aboutsummaryrefslogtreecommitdiff
path: root/cbt
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-04-01 13:44:08 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-04-02 01:28:37 -0400
commit99d3123cdbff73cb9a9dd49bc334b47a5a8b6021 (patch)
tree2abdb4cc62be231240404ccb8d41d27be03cd458 /cbt
parent7e96f539872dc28d040b24b9aa81f7cf08f8cbf3 (diff)
downloadcbt-99d3123cdbff73cb9a9dd49bc334b47a5a8b6021.tar.gz
cbt-99d3123cdbff73cb9a9dd49bc334b47a5a8b6021.tar.bz2
cbt-99d3123cdbff73cb9a9dd49bc334b47a5a8b6021.zip
saner -debug behavior
Diffstat (limited to 'cbt')
-rwxr-xr-xcbt13
1 files changed, 13 insertions, 0 deletions
diff --git a/cbt b/cbt
index 6e32e50..eac3987 100755
--- a/cbt
+++ b/cbt
@@ -137,6 +137,10 @@ foo(){
foo "$@"
+if [ ! "$DEBUG" == "" ]; then
+ shift
+fi
+
JAVA_OPTS_CBT=($DEBUG -Xmx1536m -Xss10M -XX:MaxJavaStackTraceDepth=-1 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none)
# ng on osx, install via brew install nailgun
@@ -200,10 +204,19 @@ if [ $nailgun_installed -eq 1 ] || [ "$1" = "publishSigned" ]; then
use_nailgun=1
fi
+if [ $server_up -eq 0 ] && [ ! "$DEBUG" == "" ]; then
+ echo "Can't use \`-debug\` (without \`direct\`) when nailgun is already running. If you started it up with \`-debug\` you can still connect to it. Otherwise use \`cbt kill\` to kill it."
+ exit 1
+fi
+
if [ $use_nailgun -eq 0 ] && [ ! $server_up -eq 0 ]; then
log "Starting background process (nailgun)" "$@"
# try to start nailgun-server, just in case it's not up
java "${options[@]}" "${JAVA_OPTS_CBT[@]}" -jar "$NG_SERVER_JAR" 127.0.0.1:$NAILGUN_PORT >> "$nailgun_out" 2>> "$nailgun_err" &
+ if [ ! "$DEBUG" == "" ]; then
+ echo "Started nailgun server in debug mode"
+ exit 1
+ fi
fi
stage1 () {