mirror of
https://github.com/danbulant/deno_install
synced 2026-06-19 06:21:27 +00:00
Fix PowerShell IsWindows usage (#32)
This commit is contained in:
parent
aff069cf34
commit
7edda0f115
2 changed files with 13 additions and 18 deletions
19
install.ps1
19
install.ps1
|
|
@ -10,41 +10,38 @@ param (
|
|||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
if ($PSVersionTable.PSVersion.Major -lt 6) {
|
||||
$IsWin = $true
|
||||
$IsOsx = $false
|
||||
} else {
|
||||
$IsWin = $IsWindows
|
||||
$IsOsx = $IsMacOS
|
||||
$IsWindows = $true
|
||||
$IsMacOS = $false
|
||||
}
|
||||
|
||||
$BinDir = if ($IsWin) {
|
||||
$BinDir = if ($IsWindows) {
|
||||
"$Home\.deno\bin"
|
||||
} else {
|
||||
"$Home/.deno/bin"
|
||||
}
|
||||
|
||||
$Zip = if ($IsWin) {
|
||||
$Zip = if ($IsWindows) {
|
||||
'zip'
|
||||
} else {
|
||||
'gz'
|
||||
}
|
||||
|
||||
$DenoZip = if ($IsWin) {
|
||||
$DenoZip = if ($IsWindows) {
|
||||
"$BinDir\deno.$Zip"
|
||||
} else {
|
||||
"$BinDir/deno.$Zip"
|
||||
}
|
||||
|
||||
$DenoExe = if ($IsWin) {
|
||||
$DenoExe = if ($IsWindows) {
|
||||
"$BinDir\deno.exe"
|
||||
} else {
|
||||
"$BinDir/deno"
|
||||
}
|
||||
|
||||
$OS = if ($IsWin) {
|
||||
$OS = if ($IsWindows) {
|
||||
'win'
|
||||
} else {
|
||||
if ($IsOsx) {
|
||||
if ($IsMacOS) {
|
||||
'osx'
|
||||
} else {
|
||||
'linux'
|
||||
|
|
|
|||
|
|
@ -10,16 +10,14 @@ if (!(Get-Module PSScriptAnalyzer -ListAvailable)) {
|
|||
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
|
||||
}
|
||||
|
||||
Invoke-ScriptAnalyzer *.ps1 -EnableExit
|
||||
Invoke-ScriptAnalyzer *.ps1 -Exclude PSAvoidAssignmentToAutomaticVariable
|
||||
|
||||
$IsWin = if ($PSVersionTable.PSVersion.Major -lt 6) {
|
||||
$true
|
||||
} else {
|
||||
$IsWindows
|
||||
if ($PSVersionTable.PSVersion.Major -lt 6) {
|
||||
$IsWindows = $true
|
||||
}
|
||||
|
||||
.\install.ps1 v0.2.0
|
||||
$DenoVersion = if ($IsWin) {
|
||||
$DenoVersion = if ($IsWindows) {
|
||||
deno --version
|
||||
} else {
|
||||
~/.deno/bin/deno --version
|
||||
|
|
@ -31,7 +29,7 @@ if (!($DenoVersion[0] -eq 'deno: 0.2.0')) {
|
|||
}
|
||||
|
||||
.\install.ps1
|
||||
$DenoVersion = if ($IsWin) {
|
||||
$DenoVersion = if ($IsWindows) {
|
||||
deno --version
|
||||
} else {
|
||||
~/.deno/bin/deno --version
|
||||
|
|
|
|||
Loading…
Reference in a new issue