mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-29 03:13:55 +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) {
|
if ($IsMacOS) {
|
||||||
& brew install gh
|
& brew install gh
|
||||||
} elseif ($IsLinux) {
|
} 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
|
& sudo apt install gh
|
||||||
} else {
|
} else {
|
||||||
& winget install --id GitHub.cli
|
& winget install --id GitHub.cli
|
||||||
|
@ -17,7 +17,13 @@ try {
|
|||||||
"⏳ Uninstalling GitHub CLI..."
|
"⏳ Uninstalling GitHub CLI..."
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
|
if ($IsMacOS) {
|
||||||
|
& brew uninstall gh
|
||||||
|
} elseif ($IsLinux) {
|
||||||
|
& sudo apt remote gh
|
||||||
|
} else {
|
||||||
& winget uninstall --id GitHub.cli
|
& winget uninstall --id GitHub.cli
|
||||||
|
}
|
||||||
if ($lastExitCode -ne "0") { throw "Can't uninstall GitHub CLI, is it installed?" }
|
if ($lastExitCode -ne "0") { throw "Can't uninstall GitHub CLI, is it installed?" }
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
Loading…
Reference in New Issue
Block a user