danhper / fundle

A minimalist package manager for fish shell
MIT License
375 stars 22 forks source link

BREAKING CHANGE: Match oh-my-fish compatibility behavior #48

Closed thalesmello closed 5 years ago

thalesmello commented 5 years ago

This pull request does:

After reading about a bug in theme-bobthefish regarding fundle, I realized it happened because of two things:

  1. Fundle was sourcing all the files in the root folder of theme-bobthefish, treating the function definitions as literal shell commands. Because of this, they always had higher precedence over functions defined in the files folder.

  2. Fundle was prepending all the packages' function folders in the fish_function_path, such that plugin functions had higher precedence. This wouldn't allow an overridden user function to be correctly found by fish.

After inspecting the oh-my-fish source code, I concluded the behaviour addressed the current no init.fish appears not to be correct, because of:

  1. oh-my-fish only sources init.fish files and conf.d folders inside packages
  2. oh-my-fish includes theme root folders in the fish_function_path variable.

Because the README of fundle said the current fallback behaviour for no init.fish file of sourcing *.fish in the root directory was due to preserve compatibility with oh-my-fish plugins, and that is apparantly not oh-my-fish's actual behaviour, I figured it was supposed to be different, hence this pull request.

danhper commented 5 years ago

Thanks a lot for this PR. Indeed, I think this was the behavior long before conf.d was introduced. Sourcing the files in the top directory should not be needed by any plugin in use so I think it's fine if we break backward compatibility here.