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

[feat]: doOnce with retry #289

Open
2 of 3 tasks
xenoterracide opened this issue Nov 7, 2023 · 1 comment
Open
2 of 3 tasks

[feat]: doOnce with retry #289

xenoterracide opened this issue Nov 7, 2023 · 1 comment
Assignees
Labels
feature-request 💡 Suggests new feature. no-stale 🔒 This is exempt from the stale bot

Comments

@xenoterracide
Copy link

Feature description

if a portion of an ice command fails

Related Code

so I have this code, as an example

  zi ice lucid wait \
    cloneonly nocompile notify \
    atclone"install --compare -D after/syntax/zsh.vim $VIM_AFTER_SYNTAX/zsh.vim" \
    atpull"%atclone"
  zi light z-shell/zinit-vim-syntax

the problem is that this requires GNU install. Now I can test for that in various ways, and have actually updated my code to do so in a mac environment. Before this though I just ran this code and it would work if brew (or something) had already put it on the PATH. I'd always run this code, but after an initial setup of ZI if gnu install wasn't there at a shell launch I'd have to blow away ~/.zi and run this again. I don't want to run this every time I load the shell so doing atload is out of the question. Instead what I've done is duplicated this code and checked for gnu install.

  zi ice lucid wait'[[ -f $(brew --prefix coreutils)/libexec/gnubin/install ]]' \
    cloneonly nocompile notify \
    atclone"install --compare -D after/syntax/zsh.vim $VIM_AFTER_SYNTAX/zsh.vim" \
    atpull"%atclone"
  zi light z-shell/zinit-vim-syntax

while this works for this case I'd much rather simply retry the operation on a subsequent run if it didn't work this time.

As a continuation use case

zi ice lucid wait has'asdf' atclone'asdf plugin add nodejs' for z-shell/null

doesn't seem to work I expect this is because of how the atClone cycle works

I think these could be better done like this

zi ice lucid wait retry doonce'install --compare -D after/syntax/zsh.vim $VIM_AFTER_SYNTAX/zsh.vim'
zi ice lucid wait retry has'asdf' doonce'asdf plugin add nodejs'

I would not have has returning false mark the doonce as done.

Additional Context

No response

Self-service

  • I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

xenoterracide@gmail.com

@xenoterracide xenoterracide added the feature-request 💡 Suggests new feature. label Nov 7, 2023
Copy link

github-actions bot commented Dec 8, 2023

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale 👻 No activity for quite some time. label Dec 8, 2023
@ss-o ss-o added no-stale 🔒 This is exempt from the stale bot and removed stale 👻 No activity for quite some time. labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request 💡 Suggests new feature. no-stale 🔒 This is exempt from the stale bot
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants