[go: up one dir, main page]

Remove `BundleID` requirement for import

Created by: drgrib

The choice of design on this line makes this package and any program that uses it unnecessarily hard to test. It gives no opportunity to check and prepare for a testing situation programmatically before awgo is imported.

A better approach would be to have a function like this:

func InitWorkflow() {
	wf = New()
}

This gives users an opportunity to set the environment variables in env.sh for testing after the package is imported. Here is one approach:

func main() {
	if len(os.Args) < 2 {
		InitEnvShVariables()
	}
	aw.InitWorkflow()
	aw.Run(run)
}

The way it is currently set up, I'm blocked by the BundleID error immediately on import if I run my program in a testing environment outside of Alfred without first running env.sh.

I'm currently trying to edit logic in my program that has nothing to do with awgo so it is annoying to be blocked by it simply because I'm importing it.