Comments (4)
A better approach would be to have a function like this
wf = New()
is there to allow the library-level functions to work without you having to create your own Workflow
. Requiring an InitWorkflow()
function to be called rather defeats the purpose of that, so no-go.
I agree that import-time side effects suck. Either I will make initialisation lazier or strip out the library-level functions and the default wf
Workflow.
from awgo.
Requiring an InitWorkflow() function to be called rather defeats the purpose of that, so no-go.
Another option would be to have flexible default behavior for the built-in Workflow
. I.e. have it detect that the developer hasn't put it inside a real bundle yet and have it automatically skip bundle management tasks like caching. This would actually be a much more helpful reaction to it discovering it has no BundleID
than erroring out and terminating execution.
That way they can rapidly develop the user interaction parts of the Workflow
using stdout
. Then once the program is fully polished, it can be built into an executable for use in the real Alfred bundle.
This option may be preferable because it means you don't have to change the syntax for your awgo
package and current developers can experience this benefit free of charge without changing their current code. It's honestly how I expected the package to behave when I first downloaded it and I was surprised when it started hitting me with BundleID
errors for trying to develop locally through stdout
.
You could also have a awgo.Debug = True
flag that Workflow
checks. This way it would error out if the developer tries to put it inside Alfred without specifying BundleID
, which you would still want it to do.
from awgo.
That way they can rapidly develop the user interaction parts of the Workflow using stdout
I always use a terminal to develop workflows. It's simple enough to source a script that sets the required variables.
I will remove the import-time requirement for a bundle ID because no library should explode on import. The runtime requirement will remain, however. AwGo needs the bundle ID (and cache path) for most of its functionality.
it means you don't have to change the syntax for your awgo package and current developers can experience this benefit free of charge without changing their current code
Too late for that, I'm afraid. I've refactored AwGo massively in the v0.14 branch.
Check out the new Env
interface that now underpins everything.
Currently, the Option
to pass a custom Env
to New()
isn't exported, but I'll change that (and rejigger New()
not to immediately panic if the environment variables are missing).
Then you can pass your own Env
to New()
to set the bundle ID etc. programatically. I'll probably export the mapEnv
type to make it even easier.
from awgo.
The default *Workflow and import-time requirements are gone in v0.14.
from awgo.
Related Issues (20)
- Can maybe use gon library to notarize binaries HOT 1
- Allow wf.Filter() to filter on subtitle HOT 1
- Dependabot can't resolve your Go dependency files
- Question: How to check if workflow is a rerun? HOT 3
- Question: what's the proper way to generate a workflow plist? HOT 1
- go get error with go 1.14.1 on MacOS 10.15.5 HOT 2
- Split out `fuzzy` package as a separate repo HOT 4
- Add separate icon for Magic Actions
- Add icon caching helper HOT 1
- Add script loading helper
- Change import path to go.deanishe.net/aw
- Remove Alfred 3 support
- Smarter "valid" handling
- Big Sur / M1 Issue - hanging HOT 1
- Goroutine log doesn't appear in log file
- Unable to use HOT 2
- Provide a Workflow file for settings example
- Not working for Alfred 5 HOT 1
- How I get this to run on Ventura?
- JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awgo.