Permalink
Browse files

GRAILS-9535 - make stop-app work in interactive mode

There is still an issue with the "exit" command when running in forked mode.  This isn't mentioned in the JIRA but it doesn't work.  That is really a separate issue.
  • Loading branch information...
1 parent e23211b commit 21c51444f1c8c9a7224991d6adaed14b2ede06a5 @jeffbrown jeffbrown committed Nov 18, 2012
@@ -114,8 +114,13 @@ class InteractiveMode {
}
else if ("quit".equals(trimmed)) {
goodbye()
- }
- else if (("exit".equals(trimmed)) || ("stop-app".equals(trimmed))) {
+ } else if('stop-app'.equals(trimmed)) {
+ if(settings.forkSettings?.get('run')) {
+ parseAndExecute 'stop-app'
+ } else {
+ stopApp()
+ }
+ } else if ("exit".equals(trimmed)) {
exit()
}
else if (scriptName.startsWith("open ")) {
@@ -175,7 +180,7 @@ class InteractiveMode {
System.exit(0)
}
- protected void exit() {
+ protected void stopApp() {
if (grailsServer) {
try {
updateStatus "Stopping Grails server"
@@ -187,6 +192,12 @@ class InteractiveMode {
grailsServer = null
}
}
+ }
+
+ protected void exit() {
+ if (grailsServer) {
+ stopApp()
+ }
else {
goodbye()
}

0 comments on commit 21c5144

Please sign in to comment.