blob: d27c97bcad0ec803ab3d090d485b891450b3be1a [file] [log] [blame]
Derek Baum99446702010-05-13 17:32:34 +00001# default gosh_profile
2# only read if etc/gosh_profile doesn't exist relative to the System property
3# gosh.home or failing that the current directory.
4
Derek Baum772d0772010-06-24 21:20:30 +00005# catch all exceptions from this script to avoid it aborting startup
Derek Baum99446702010-05-13 17:32:34 +00006try {
Derek Baum772d0772010-06-24 21:20:30 +00007
8 # ensure gogo commands are found first
9 SCOPE = gogo:*
10
11 # add methods on BundleContext object as commands
12 #addcommand context ${.context} (${.context} class)
13 # bug: above invokes (String, Object, String) instead of (String, Object, Class)
14 addcommand context ${.context}
15
16 # add methods on System object as commands
Derek Baumd3d3eff2011-04-21 13:07:45 +000017 addcommand system (((${.context} bundles) 0) loadclass java.lang.System)
Derek Baum772d0772010-06-24 21:20:30 +000018
19 # alias to print full stack trace
20 e = { $exception printStackTrace }
21
22 ## disable console auto-formatting of each result
23 # you will then need to explicitly use the 'format' command
24 # to print the result of commands that don't write to stdout.
25 #.Gogo.format = false
26
27 ## disable printing the formatted result of a command into pipelines
28 #.Format.Pipe = false
29
30 # set prompt
31 prompt = 'g! '
32
33 # print welcome message
Derek Baum99446702010-05-13 17:32:34 +000034 cat ($0 resolve motd)
Derek Baum772d0772010-06-24 21:20:30 +000035} {
36 echo "$0: ERROR: $exception"
Derek Baum99446702010-05-13 17:32:34 +000037}
38
39# end