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

fix: Run AstroUpdate before Lazy sync #473

Merged
merged 2 commits into from
Jun 23, 2023
Merged

fix: Run AstroUpdate before Lazy sync #473

merged 2 commits into from
Jun 23, 2023

Conversation

slowsage
Copy link
Contributor

@slowsage slowsage commented Jun 15, 2023

AstroNvim switched to using Lazy to manage plugins some weeks back.
For users of AstroNvim:

  • Without this PR, topgrade runs Lazy sync (since :Lazy exists via AstroNvim) and quits without updating AstroNvim.
  • With this PR, AstroUpdate is called if it exists before checking for existence of Lazy.nvim. AstroUpdate will update the plugins (using Lazy currently) as needed. So the explicit call to Lazy sync in upgrade.vim becomes unnecessary.

I suggest that users of AstroNvim add

  updater = {
    skip_prompts = true,
  },

to their init.lua to automatically confirm and quit AstroNvim after AstroUpdate and skip the redundant call to Lazy sync.
Users not using AstroNvim should be unaffected.

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself
    • I also tested that Topgrade skips the step where needed

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

src/steps/upgrade.vim Outdated Show resolved Hide resolved
@SteveLauC
Copy link
Member

Except for that doc nitpick, this PR LGTM:)

@slowsage
Copy link
Contributor Author

slowsage commented Jun 16, 2023

Please hold off on merging. Just realized I need to test one more case. Might need to change the comment/code. I'll comment back when its ready. Apologies.

@slowsage
Copy link
Contributor Author

Turns out the auto_quit option only gets triggered when there are updates. So we need to call quitall to cover that case. It's ready to be merged. Thank you.

@s34m s34m merged commit d770949 into topgrade-rs:master Jun 23, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants