jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.55k stars 257 forks source link

Remove support for .fish files outside a functions directory #651

Closed jorgebucaran closed 3 years ago

jorgebucaran commented 3 years ago

Functions to functions/. Completions to completions/. Shell startup snippets to conf.d/. That leaves top-level .fish files out of place. Very much in line with Python's "there should be one—and preferably only one—obvious way to do it", and Fish's law of orthogonality, I want to drop support for top-level .fish files on principle.

I'm thinking of doing this in the following steps:

If a plugin suddenly stops working, nicely ask the maintainers to modernize it, or even better, send them a PR moving all top-level .fish files into the functions directory.

domoritz commented 3 years ago

Hi @jorgebucaran. I got a warning about https://github.com/oh-my-fish/plugin-pyenv and https://github.com/oh-my-fish/plugin-cd not being supported anymore. I guess it's because of the init.fish files, right? Is it enough to just move them to conf.d/ or somewhere else? What about uninstall.fish in plugin-cd?

jorgebucaran commented 3 years ago

To modernize an Oh My Fish! plugin:

  1. Move init.fish to conf.d/plugin_name.fish
  2. Copy top-level functions ./*.fish to functions.
  3. Erase uninstall.fish. Use event system instead.
domoritz commented 3 years ago

Done in https://github.com/oh-my-fish/plugin-cd/pull/15 and https://github.com/oh-my-fish/plugin-pyenv/pull/9.

joseluisq commented 3 years ago

I don't know if you have thought about it but how about script (.fish) files that you don't want to pack to users like testing or automation intended ones? How do we tell Fisher about it? Is not suitable to just skip "top-level" script files?

Those are some concerns since newer Fisher shows fisher: Plugin not supported: during installations that contains .fish script files outside Fish dirs.

jorgebucaran commented 3 years ago

When installing plugins, in addition to .fish files, we also copy any files and directories inside your plugin functions/, conf.d/, and completions/ to $fisher_path under functions/, conf.d, and completions respectively, allowing you to access these resources easily (#581).

You can also place .fish files in directories in the top-level, for example, I put Fisher tests in tests/.

joseluisq commented 3 years ago

I put Fisher tests in tests/.

I did the same and now no more messages but my question is more about what do we need to care about "top-level" script files? Can Fisher just skip them since Fish dirs are well known.

jorgebucaran commented 3 years ago

Fisher ignores top-level .fish files. I think the error message is confusing and makes people mistakenly think Fisher won't install the plugin. I am just going to remove the warning in the next minor bump (#666). 🤘