I would like to create a clipping for my Go files that inserts the correct 
package name. The package name can be inferred from the directory of the 
current file.

For example:

workspace/src/github.com/ascarter/foo/bar/stuff.go:

package bar

func SomeFunc() {
        fmt.Println("hello")
}

I can get the filename, basename, or extension but I can't get the parent 
directory using the built-in substitution parameters. Using #SYSTEM# seems 
like it could work except that $BB_DOC_PATH is not set nor does there seem 
to be a way to get the document that I'm in. I tried using osascript -e 
call but that creates some sort of weird loop with BBEdit and hangs.

Anyone have a solution for getting either full path in #SYSTEM# or some 
other way to get the parent directory name? I just need "bar" in my use 
case above. I can make several convenient clippings if I can get this 
package name from the current document context.

Thanks,
Andrew

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to