blob: 98eb0c5e1afdd819d48d947d1543dceb0647ce6d [file] [log] [blame]
Derek Baumbd5b6082010-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 Baum44a3f792010-06-24 21:20:30 +00005# catch all exceptions from this script to avoid it aborting startup
Derek Baumbd5b6082010-05-13 17:32:34 +00006try {
Derek Baum44a3f792010-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 Baum194f10e2011-04-21 13:07:45 +000017 addcommand system (((${.context} bundles) 0) loadclass java.lang.System)
Derek Baum44a3f792010-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
Jan Willem Janssen90e9c912016-01-19 15:43:28 +000033 # print welcome message, unless we're explicitly told not to...
34 if {$.gosh_quiet} {} { cat ($0 resolve motd) }
Derek Baum44a3f792010-06-24 21:20:30 +000035} {
36 echo "$0: ERROR: $exception"
Derek Baumbd5b6082010-05-13 17:32:34 +000037}
38
39# end