sindresorhus/alfy

How do I install a workflow into Alfred?

motleydev opened this issue · 5 comments

Sorry for the dumb question, but how do I then add a project into Alfred? I'm sure I'm missing something obvious.

It's right in the readme: https://github.com/sindresorhus/alfy#publish-to-npm

$ npm install --global alfred-workflow-name

Sorry, I gathered that - but I'm confused how to add local code to Alfred. For example, when I run, presumable npm run postinstall - shouldn't that add my doc locally? Tests just give pass fail, no ability to preview the out?

Something like this might be helpful: ln -s ~/code/alfred-x ~/Alfred.alfredpreferences/workflows/alfred-x

@motleydev No it does not for a good reason. The postinstall hook changes your info.plist, you don't want that during development. Run ./node_modules/.bin/alfy-init directly which will trigger alfred-link. I agree that this should be mentioned in the docs or we should come up with a better process for this.

@SamVerschueren This is still relevant.

I'm creating a workflow for the first time, I've used generator-alfred but couldn't understand how to actually connect my code to a working workflow in Alfred for testing.

Running ./node_modules/.bin/alfy-init worked.
Running the same from a package.json script didn't work:
"init": "./node_modules/.bin/alfy-init",
What's the difference?

And the next step was to figure out a workflow of how to make code changes and test it in Alfred live, without running ./node_modules/.bin/alfy-cleanup and then ./node_modules/.bin/alfy-init every time (just now thinking about it).

I'd expect the Readme to cover this somehow.

Perhaps this is useful:
https://www.alfredforum.com/topic/9251-what-is-your-workflow-for-developing-these-workflows/

Overall I think Alfy is awesome :-D.