diff --git a/README.md b/README.md index 8ff2463..b3bc910 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,6 @@ curl -fsSL https://deno.land/install.sh | sh irm https://deno.land/install.ps1 | iex ``` -## Install Globally - -**With PowerShell:** - -```powershell -$g; irm https://deno.land/install.ps1 | iex -``` - ## Install Specific Version **With Shell:** @@ -101,6 +93,14 @@ brew install protobuf # macOS cargo install deno ``` +## Install Globally + +**With PowerShell:** + +```powershell +$denoGlobalInstall; irm https://deno.land/install.ps1 | iex +``` + ## Install and Manage Multiple Versions **With [asdf](https://asdf-vm.com) and [asdf-deno](https://github.com/asdf-community/asdf-deno):** diff --git a/install.ps1 b/install.ps1 index c340397..d0e7191 100644 --- a/install.ps1 +++ b/install.ps1 @@ -4,16 +4,16 @@ $ErrorActionPreference = 'Stop' -if ($v) { - $Version = "v${v}" -} elseif ($Args.Length -eq 1) { +if ($Args.Length -eq 1) { $Version = $Args[0] +} elseif ($v) { + $Version = "v${v}" } $DenoInstall = $env:DENO_INSTALL $BinDir = if ($DenoInstall) { "${DenoInstall}\bin" -} elseif (Test-Path variable:\g) { +} elseif (Test-Path variable:\denoGlobalInstall) { "${Env:ProgramFiles}\deno\bin" } else { "${Home}\.deno\bin" @@ -39,7 +39,7 @@ tar.exe xf $DenoZip -C $BinDir Remove-Item $DenoZip -$EnvTarget = if (Test-Path variable:\g) { +$EnvTarget = if (Test-Path variable:\denoGlobalInstall) { [System.EnvironmentVariableTarget]::Machine } else { [System.EnvironmentVariableTarget]::User