matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.52k stars 643 forks source link

JSON files should be ignored in plugins folder #842

Open dzg opened 2 years ago

dzg commented 2 years ago

Some of my scripts generate JSON in the plugins folder, and xbar tries to load them with error chmod +x ...

Seems JSON should be ignored – they couldn't possibly generate output.

Etheryte commented 2 years ago

In a broader sense, it would probably make sense to ignore all files that don't have the execute permission.

matryer commented 2 years ago

I think @Etheryte has a point - it shouldn't even try if it's not executable. Although it's a common bug, so seeing the error is quite nice.

I think we already ignore dotfiles, so @dzg maybe you can try that?

j0k3r commented 1 year ago

An other case is when using a JavaScript file as plugin, we can have deps for that files which generates package.json & package-lock.json in the plugin folder. It then generate useless stuff:

image

The only work around, is to remove them, refresh xbar and re-add them. Maybe we can have a .xbarignore file in the plugin folder which might contain path to file which will be ignored by xbar when loading the plugin folder. What do you think?

williamgoulois commented 1 year ago

I have the same problem using a Javascript file as plugin. My workaround is to first init package.json, then add dependencies of the plugin and then "hide" the package-lock.json and package.json from xbar by adding a . The script should work because there are still node_modules folder and it is ignored by xbar.

Whenever i need to make an update on the dependencies I just remove the . from files and hide them just after

Would be cool to only detect executable files though