Revision: 17092
          http://sourceforge.net/p/gate/code/17092
Author:   johann_p
Date:     2013-11-14 13:51:06 +0000 (Thu, 14 Nov 2013)
Log Message:
-----------
Make -ld and -ln work with both absolute and relative
pathnames.

Modified Paths:
--------------
    gate/trunk/bin/gate.sh

Modified: gate/trunk/bin/gate.sh
===================================================================
--- gate/trunk/bin/gate.sh      2013-11-14 12:11:28 UTC (rev 17091)
+++ gate/trunk/bin/gate.sh      2013-11-14 13:51:06 UTC (rev 17092)
@@ -74,6 +74,23 @@
     fi
 }
 
+## function that returns, for a root directory and an absolute or 
+## relative path, the absolute path.
+function abs_path() {
+  rootdir="$1"
+  path="$2"
+  case "$path" in
+  /*)
+    ## this is already an absolute path, use it
+    path="$path"
+    ;;
+  *)
+    path="${rootdir}"/"${path}"
+    ;;
+  esac
+  echo "$path"
+}
+
 while test "$1" != "";
 do
   case "$1" in
@@ -106,8 +123,8 @@
     ;;
   -ld)
     shift
-    vmparams=( "${vmparams[@]}" "-Dgate.user.config=$CURDIR/.gate.xml" )
-    vmparams=( "${vmparams[@]}" "-Dgate.user.session=$CURDIR/.gate.session" )
+    vmparams=( "${vmparams[@]}" "-Dgate.user.config=$(abs_path $CURDIR 
.gate.xml)" )
+    vmparams=( "${vmparams[@]}" "-Dgate.user.session=$(abs_path $CURDIR 
.gate.session)" )
     vmparams=( "${vmparams[@]}" "-Dgate.user.filechooser.defaultdir=$CURDIR" )
     copy_default_files ".gate"
     ;;
@@ -115,8 +132,8 @@
     shift
     base=$1
     shift
-    vmparams=( "${vmparams[@]}" "-Dgate.user.config=$CURDIR/$base.xml" )
-    vmparams=( "${vmparams[@]}" "-Dgate.user.session=$CURDIR/$base.session" )
+    vmparams=( "${vmparams[@]}" "-Dgate.user.config=$(abs_path $CURDIR 
$base.xml)" )
+    vmparams=( "${vmparams[@]}" "-Dgate.user.session=$(abs_path $CURDIR 
$base.session)" )
     vmparams=( "${vmparams[@]}" "-Dgate.user.filechooser.defaultdir=$CURDIR" )
     copy_default_files "$base"
     ;;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to