From 93652032453daf35d97574b94a1111b008774a60 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 10 Aug 2023 14:47:49 +0200 Subject: [PATCH] Update install-github-cli.ps1 and uninstall-github-cli.ps1 --- Scripts/install-github-cli.ps1 | 3 --- Scripts/uninstall-github-cli.ps1 | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Scripts/install-github-cli.ps1 b/Scripts/install-github-cli.ps1 index 5fdd72a5..2454489d 100755 --- a/Scripts/install-github-cli.ps1 +++ b/Scripts/install-github-cli.ps1 @@ -20,9 +20,6 @@ try { if ($IsMacOS) { & brew install gh } elseif ($IsLinux) { - & curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - & sudo apt update & sudo apt install gh } else { & winget install --id GitHub.cli diff --git a/Scripts/uninstall-github-cli.ps1 b/Scripts/uninstall-github-cli.ps1 index a29a1ebc..54cc3491 100644 --- a/Scripts/uninstall-github-cli.ps1 +++ b/Scripts/uninstall-github-cli.ps1 @@ -17,7 +17,13 @@ try { "⏳ Uninstalling GitHub CLI..." $StopWatch = [system.diagnostics.stopwatch]::startNew() - & winget uninstall --id GitHub.cli + if ($IsMacOS) { + & brew uninstall gh + } elseif ($IsLinux) { + & sudo apt remote gh + } else { + & winget uninstall --id GitHub.cli + } if ($lastExitCode -ne "0") { throw "Can't uninstall GitHub CLI, is it installed?" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds