jorgebucaran / fisher

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

$fisher_path is no longer available during plugin installation/update/removal #643

Closed d3dave closed 3 years ago

d3dave commented 3 years ago

When trying to use b4b4r07/enhancd I'm getting an error:

> cd somewhere
awk: can't open file /functions/enhancd/lib/fuzzy.awk

This happens because $fisher_path is empty during the plugin installation. See https://github.com/b4b4r07/enhancd/blob/master/conf.d/enhancd.fish#L6 .

This looks like a bug, introduced in fisher here: https://github.com/jorgebucaran/fisher/commit/5a81014f22f8a58e01970c8832b370af1c1edcec#diff-bbbdf83c74a73435089c371d30fc66f1707650fcc73a10e04e9b8b423f272262L7 when the variable scope was changed from global to local for some reason.

As I see it, there are two options to fix this:

  1. Change enhancd to support an empty $fisher_path, in which case it would default to $__fish_config_path, just like in fisher. Or,
  2. Set $fisher_path globally, so plugins have access to it during installation.

Since (2) is resilient to future changes in fisher, I think it's clear that it is the correct approach.

jorgebucaran commented 3 years ago

Or

  1. Use status filename to detect the plugin's root directory, e.g.: https://github.com/IlanCosman/tide/pull/65.

Plugins should not rely on Fisher specific variables, so for enhancd, I think our best course of action is 3.