mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 17:33:17 +01:00
Update install-github-cli.ps1 and uninstall-github-cli.ps1
This commit is contained in:
parent
74811f7fe6
commit
9365203245
@ -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
|
||||
|
@ -17,7 +17,13 @@ try {
|
||||
"⏳ Uninstalling GitHub CLI..."
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user