You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/10/03 22:55:33 UTC

[sling-org-apache-sling-app-cms] branch master updated: SLING-8697 - CMS - Start / Stop Script Set Working Directory (#6)

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to refs/heads/master by this push:
     new 12e70e5  SLING-8697 - CMS - Start / Stop Script Set Working Directory (#6)
12e70e5 is described below

commit 12e70e57178e78ea1785ce909dab88940f248e36
Author: Miroslav <mi...@mibesis.si>
AuthorDate: Fri Oct 4 00:55:28 2019 +0200

    SLING-8697 - CMS - Start / Stop Script Set Working Directory (#6)
    
    Thanks @miroslav-beranic !
---
 .gitignore                        |  3 ++-
 builder/src/main/scripts/start.sh | 10 +++++++++-
 builder/src/main/scripts/stop.sh  |  6 +++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3749cbd..d436450 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,5 @@ bin
 .vlt-sync.log
 .brackets.json
 .metadata/
-.vagrant/
\ No newline at end of file
+.vagrant/
+*.iml
\ No newline at end of file
diff --git a/builder/src/main/scripts/start.sh b/builder/src/main/scripts/start.sh
index 6fca4b5..493d84e 100755
--- a/builder/src/main/scripts/start.sh
+++ b/builder/src/main/scripts/start.sh
@@ -21,6 +21,10 @@
 # The following variables may be used to override the defaults.
 #
 
+script="$0"
+basename="$(dirname $script)"
+cd $basename
+
 # port used for accessing the app
 if [ -z "$APP_PORT" ]; then
 	APP_PORT=8080
@@ -46,6 +50,10 @@ fi
 START_OPTS="${START_OPTS}"
 
 JARFILE=`ls *cms*.jar | head -1`
+if [ -z "$JARFILE" ]; then
+  echo "No CMS JAR file found."
+  exit 1
+fi
 mkdir -p sling/logs
 (
   (
@@ -53,4 +61,4 @@ mkdir -p sling/logs
     echo $! > app.pid
   ) >> sling/logs/stdout.log 2>&1
 ) &
-echo "Application started on port ${APP_PORT}!"
\ No newline at end of file
+echo "Application started on port ${APP_PORT}!"
diff --git a/builder/src/main/scripts/stop.sh b/builder/src/main/scripts/stop.sh
index 1d2ae5b..24f0bfa 100755
--- a/builder/src/main/scripts/stop.sh
+++ b/builder/src/main/scripts/stop.sh
@@ -20,6 +20,10 @@
 
 START_OPTS='stop -c .'
 JARFILE=`ls *cms*.jar | head -1`
+if [ -z "$JARFILE" ]; then
+  echo "No CMS JAR file found."
+  exit 1
+fi
 
 java -jar $JARFILE $START_OPTS
 STOP_CODE=$?
@@ -43,4 +47,4 @@ else
 		STOP_CODE=4
 	fi
 fi
-exit ${STOP_CODE}
\ No newline at end of file
+exit ${STOP_CODE}