awgo icon indicating copy to clipboard operation
awgo copied to clipboard

Not working for Alfred 5

Open IamTheFij opened this issue 3 years ago • 1 comments

It looks like the library determines that Version 4 is being used because we're using the non-numbered Alfred folder. This folder is apparently used for all new versions.

Two possible fixes:

  • Use the max version found in the version keys in that file
  • Always use "current"

I'm leaning towards the latter.

IamTheFij avatar Mar 15 '23 16:03 IamTheFij

For the time being, I'm working around this with:

func InfoWithVersion(v int) build.Option {
	return func(i *build.Info) {
		i.AlfredMajorVersion = v
	}
}

func init() {
	var err error
	if info, err = build.NewInfo(InfoWithVersion(5)); err != nil {
		panic(err)
	}
}

If it works well enough with 0 as the version, then the current approach should work.

Additionally, this can be worked around with no code change and setting the version in the environment before running the build. Eg. env alfred_version=5 mage build

IamTheFij avatar Mar 15 '23 17:03 IamTheFij