File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,14 @@ install_gh_linux_apt() {
124124install_gh_linux_dnf () {
125125 info " Installing GitHub CLI with dnf (Fedora/RHEL-compatible)."
126126 run_as_root dnf install -y ' dnf-command(config-manager)' || warn " dnf-command(config-manager) may already be installed; continuing."
127- run_as_root dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo || error " Failed to add gh dnf repository."
127+ local gh_repo=" https://cli.github.com/packages/rpm/gh-cli.repo"
128+ # DNF 5 (Fedora 41+): addrepo --from-repofile=. DNF 4: --add-repo URL
129+ # See https://dnf5.readthedocs.io/en/stable/dnf5_plugins/config-manager.8.html
130+ if dnf config-manager addrepo --help > /dev/null 2>&1 ; then
131+ run_as_root dnf config-manager addrepo --from-repofile=" ${gh_repo} " || error " Failed to add gh dnf repository."
132+ else
133+ run_as_root dnf config-manager --add-repo " ${gh_repo} " || error " Failed to add gh dnf repository."
134+ fi
128135 run_as_root dnf install -y gh || error " dnf failed to install gh."
129136}
130137
You can’t perform that action at this time.
0 commit comments