felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1762577 - /felix/trunk/gogo/jline/src/main/resources/gosh_profile
Date Tue, 27 Sep 2016 21:53:37 GMT
Author: gnodet
Date: Tue Sep 27 21:53:37 2016
New Revision: 1762577

URL: http://svn.apache.org/viewvc?rev=1762577&view=rev
Log:
[gogo-jline] Fix uri resolution from shell init script

Modified:
    felix/trunk/gogo/jline/src/main/resources/gosh_profile

Modified: felix/trunk/gogo/jline/src/main/resources/gosh_profile
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/resources/gosh_profile?rev=1762577&r1=1762576&r2=1762577&view=diff
==============================================================================
--- felix/trunk/gogo/jline/src/main/resources/gosh_profile (original)
+++ felix/trunk/gogo/jline/src/main/resources/gosh_profile Tue Sep 27 21:53:37 2016
@@ -87,7 +87,6 @@ try {
       $candidates
   }
 
-  setopt pad-prompts
   setopt group
 
   complete -c gogo:complete -e
@@ -280,7 +279,20 @@ try {
   complete -c gogo:wc -a '__files'
 
   # print welcome message
-  cat ($0 resolve motd)
+  __resolve_uri = {
+    uri = $1
+    path = $2
+    if { "$uri" startsWith "jar:" } /* then */ {
+      idx = ("$uri" indexOf "!")
+      p1 = ("$uri" substring 0 $idx)
+      p2 = "!"
+      p3 = (new java.net.URI ("$uri" substring %(idx+1))) resolve $path
+      "$p1$p2$p3"
+    } /* else */ {
+      $uri resolve $path
+    }
+  }
+  cat (__resolve_uri $0 motd)
 } {
     echo "$0: ERROR: $exception"
 }



Mime
View raw message