felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From db...@apache.org
Subject svn commit: r957718 - /felix/trunk/gogo/shell/src/main/resources/gosh_profile
Date Thu, 24 Jun 2010 21:20:31 GMT
Author: dbaum
Date: Thu Jun 24 21:20:30 2010
New Revision: 957718

URL: http://svn.apache.org/viewvc?rev=957718&view=rev
Log:
FELIX-2446 eclose whole gosh_profile in try {} block to stop errors from aborting startup

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

Modified: felix/trunk/gogo/shell/src/main/resources/gosh_profile
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/resources/gosh_profile?rev=957718&r1=957717&r2=957718&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/resources/gosh_profile (original)
+++ felix/trunk/gogo/shell/src/main/resources/gosh_profile Thu Jun 24 21:20:30 2010
@@ -2,34 +2,38 @@
 # only read if etc/gosh_profile doesn't exist relative to the System property
 # gosh.home or failing that the current directory.
 
-# ensure gogo commands are found first
-SCOPE = gogo:*
+# catch all exceptions from this script to avoid it aborting startup
+try {
 
-# add methods on BundleContext object as commands
-#addcommand context ${.context} (${.context} class)
-# bug: above invokes (String, Object, String) instead of (String, Object, Class)
-addcommand context ${.context}
+  # ensure gogo commands are found first
+  SCOPE = gogo:*
 
-# add methods on System object as commands
-addcommand system ((context:bundle 0) loadclass java.lang.System)
+  # add methods on BundleContext object as commands
+  #addcommand context ${.context} (${.context} class)
+  # bug: above invokes (String, Object, String) instead of (String, Object, Class)
+  addcommand context ${.context}
 
-# alias to print full stack trace
-e = { $exception printStackTrace }
+  # add methods on System object as commands
+  addcommand system ((${.context} bundle 0) loadclass java.lang.System)
 
-## disable console auto-formatting of each result
-#  you will then need to explicitly use the 'format' command
-#  to print the result of commands that don't write to stdout.
-#.Gogo.format = false
+  # alias to print full stack trace
+  e = { $exception printStackTrace }
 
-## disable printing the formatted result of a command into pipelines
-#.Format.Pipe = false
+  ## disable console auto-formatting of each result
+  #  you will then need to explicitly use the 'format' command
+  #  to print the result of commands that don't write to stdout.
+  #.Gogo.format = false
 
-# set prompt
-prompt = 'g! '
+  ## disable printing the formatted result of a command into pipelines
+  #.Format.Pipe = false
 
-# print welcome message
-try {
+  # set prompt
+  prompt = 'g! '
+
+  # print welcome message
   cat ($0 resolve motd)
+} {
+    echo "$0: ERROR: $exception"
 }
 
 # end



Mime
View raw message