rossmacarthur / sheldon

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

Scheduled plugin update #101

Closed rossmacarthur closed 3 years ago

rossmacarthur commented 3 years ago

At the moment you can update all plugins using the following

sheldon lock --update

But there is no way to make sheldon run that periodically. It would be nice to make sheldon run that daily, weekly, fortnightly or a completely arbitrary period.

From https://github.com/rossmacarthur/sheldon/issues/61#issuecomment-617645339

Proposed solution

I think we could have the following in the config file

[update]
every = "2 weeks"

or

[update]
every = "1 month"

We would then store the last updated time somewhere, and if the current time is greater than the last updated time plus the every value then we try update, regardless of the command executed (lock or source).

We could accept hours, days, weeks, months, and years.

Unresolved questions

tapeinosyne commented 3 years ago

I feel that a built-in scheduled update mechanism would be dispensable, given how strongly established is the practice of delegating such tasks to specialized tools such as cron. Moreover, there are not many CLI utilities — none come to mind, to be entirely honest! — that will spontaneously perform an update when given unrelated commands.

Perhaps it would be best to keep things lean, here?

rossmacarthur commented 3 years ago

I agree, that sounds reasonable, I'm okay with not implementing this.