Jump to content

Better file search - advanced options 🥷


Recommended Posts

Hi all 👋

 

I'd like to present you this workflow

Allowing you to modify file-search to be much more robust.

 

You can exclude node_modules and hidden files, specify search paths and exclude paths, search just git repos, and much more 

 

For now, we're supporting opening VSCode with the giving search results, and your preferred terminal (configurable 🎩)

 

 

ENJOY 🎉

Link to comment

A couple of notes:

  1. When node is not installed, you suggest installing it to /usr/local/bin. People on Apple Silicon Macs are less likely to have that because Homebrew installs to a different location.
  2. The code is minified and obfuscated. That offers zero advantage on a workflow (saving a couple of bytes doesn’t matter) but is a major disadvantage because no one is able to inspect it.

Link to comment
On 6/10/2024 at 3:22 PM, vitor said:

A couple of notes:

  1. When node is not installed, you suggest installing it to /usr/local/bin. People on Apple Silicon Macs are less likely to have that because Homebrew installs to a different location.
  2. The code is minified and obfuscated. That offers zero advantage on a workflow (saving a couple of bytes doesn’t matter) but is a major disadvantage because no one is able to inspect it.

 

 

I see...

Here is the logic of getting all user paths, including Node.js
Do you see any problem here?

As for the minifying - that's the default for fast-alfred

Do you think we should change that?

Edited by Aviv
Link to comment
1 hour ago, Aviv said:

Here is the logic of getting all user paths, including Node.js
Do you see any problem here?

 

You shouldn’t be trying to guess the PATH from the user’s shell. Not only is that unreliable and shell dependent, it makes your code non-portable between machines. You should use the PATH available from Alfred. See Understanding the Scripting Environment.

 

2 hours ago, Aviv said:

As for the minifying - that's the default for fast-alfred

Do you think we should change that?

 

Definitely. Users expect to be able to inspect workflows and obfuscation makes that impossible. For safety, an obfuscated workflow wouldn’t be accepted to the Gallery. Which is not to say that removing the obfuscation automatically makes it suitable for inclusion—it might not, those cases are evaluated on a per-workflow basis—but being obfuscated is a definite no-no, like unsigned binaries or attempting to bypass Gatekeeper.

Link to comment
1 hour ago, gingerbeardman said:

Maybe you can do

$(which node)

to get the user's current default path for node?

 

Yeah I thought about that...
@vitor What do you think?

 

 

1 hour ago, vitor said:

Definitely. Users expect to be able to inspect workflows and obfuscation makes that impossible. For safety, an obfuscated workflow wouldn’t be accepted to the Gallery. Which is not to say that removing the obfuscation automatically makes it suitable for inclusion—it might not, those cases are evaluated on a per-workflow basis—but being obfuscated is a definite no-no, like unsigned binaries or attempting to bypass Gatekeeper.

 

So, if I'm getting you right - we should change the default to `false`, and let consumers apply minification, if needed, by configuration 👍

Link to comment
2 hours ago, vitor said:

You don’t need to know node’s full path. Use an env shebang or call just node. You only need to know if it’s present in PATH. hash node returns 0 if it finds it and 1 if not. Symlinks are taken into account, that’s what those Homebrew paths are.

 

Thank you! 🎉

Just released `fast-alfred` with the relevant changes 🚀

You can find out all of the related workflows here:

https://github.com/Avivbens/alfred-kill-process

https://github.com/Avivbens/alfred-search-bookmark

https://github.com/Avivbens/alfred-advance-fs-search

https://github.com/Avivbens/alfred-engage-contact


For workflow template using `fast-alfred`, see this repo

Edited by Aviv
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...