rossmacarthur / sheldon

:bowtie: Fast, configurable, shell plugin manager
https://sheldon.cli.rs
Apache License 2.0
960 stars 21 forks source link

Check local plugins each time `sheldon source` is run #102

Closed rossmacarthur closed 3 years ago

rossmacarthur commented 3 years ago

The problem

Consider the following config.

[plugins.myplugin]
local = "~/.zsh/myplugin"
use = "*.zsh"  # use all files matching `*.zsh`

where ~/.zsh/myplugin contains x.zsh.

When sheldon runs for the first time it will generate a lock file that references x.zsh. If a new file y.zsh is added to this directory sheldon will not discover it unless the user explicitly runs sheldon lock.

Proposed solution

Local plugins are inexpensive to check and are much more likely to change between sheldon runs. Sheldon could completely recheck these plugins each time sheldon source is run.

Unresolved questions

  1. Should this be configurable?
  2. Should this be opt in or opt out?
  3. Would there be any perceived overhead to checking this?
rossmacarthur commented 3 years ago

I have decided that I'm not going to implement this. The better workaround would be to have a separate plugin entry for each file in this directory.