Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reminders #346

Open
mooreye opened this issue Jul 20, 2023 · 6 comments
Open

Update reminders #346

mooreye opened this issue Jul 20, 2023 · 6 comments
Labels
NYI/NewFeat Not yet implemented or New Feature

Comments

@mooreye
Copy link

mooreye commented Jul 20, 2023

Do you think it would be a good idea to implement auto-reminders in the shell, by default every 2 weeks or so, to run ble-update? oh-my-zsh has this.

@akinomyoga
Copy link
Owner

I once thought about it but decided not to implement it as the default behavior.

One of the reasons is that an automatic update can pull an unstable version. Since ble.sh is continuously developed, the latest commit is sometimes unstable for a short period. Also, the update can introduce breaking changes to a configuration interface. For these reasons, I would like users to update ble.sh when they have time and are prepared to adjust their configurations and handle or report possible issues caused by the updates. I wouldn't like to suggest users update ble.sh on random occasions regardless of the users' situation.

Nevertheless, I guess it would be useful to have an extra module for such behavior as an opt-in feature. I'd accept a PR in the blesh-contrib repository.

@akinomyoga akinomyoga added the NYI/NewFeat Not yet implemented or New Feature label Jul 20, 2023
@mooreye
Copy link
Author

mooreye commented Jul 20, 2023

How about updating to the latest non-master tagged version?

@akinomyoga
Copy link
Owner

The non-master tagged version is rarely updated less than once per year.

@mooreye
Copy link
Author

mooreye commented Jul 23, 2023

This was easy enough to implement, this is a small PoC that I started using myself at the end of ~/.bashrc:

# 'ble.sh' update checker
if [[ $- == *i* && -d $HOME/.blesh/.git ]]; then
    _blesh_check() {
        local file=$HOME/.blesh/.git/FETCH_HEAD
        if [[ ! -f $file ]]; then
            echo "ble.sh never updated, consider running 'ble-update'"
        elif local days_ago=14 && [[ $(find "$file" -mtime "+$days_ago" -print) ]]; then
            echo "ble.sh older than $days_ago days, consider running 'ble-update'"
        fi
    }
    _blesh_check
fi

@jkemp814
Copy link

jkemp814 commented Apr 4, 2024

How can I make ble-update run in a script? I keep getting command not found, even though it will run at prompt fine.

@akinomyoga
Copy link
Owner

See README §1.5:

$ bash /path/to/ble.sh --update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI/NewFeat Not yet implemented or New Feature
Projects
None yet
Development

No branches or pull requests

3 participants