r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 160 forks source link

Add support for upgrading GitHub CLI extensions #868

Closed rm3l closed 2 years ago

rm3l commented 2 years ago

I want to suggest a new step

Upgrade all GitHub CLI extensions.

Which tool is this about? Where is its repository?

GitHub CLI extensions are custom commands for the GitHub CLI that anyone can create and use. Once installed locally, they can be upgraded from their respective repos. See https://docs.github.com/en/github-cli/github-cli/using-github-cli-extensions

Which operating systems are supported by this tool?

What should Topgrade do to figure out if the tool needs to be invoked?

A version subcommand could be used to figure out if the gh command is available in the path:

gh version

Which exact commands should Topgrade run?

gh extension upgrade --all

More information

Assuming that someone else implements the feature, please state if you know how to test it from a side branch of Topgrade.

Compile code and test the binary and see if it detects and runs the upgrade correctly. Output (at this time) looks like so:

―― 23:13:01 - GitHub CLI extensions ―――――――――――――――――――――――――――――――――――――――――――――――――――――――
[clone-org]: already up to date
[graph]: already up to date                                                                      
[oblique]: already up to date
[org-repo-sync]: local extensions can not be upgraded
[star]: already up to date
✓ Successfully upgraded extensions

Thanks.