mirror of
https://github.com/danbulant/deno_install
synced 2026-06-18 05:51:32 +00:00
43 lines
788 B
PowerShell
43 lines
788 B
PowerShell
#!/usr/bin/env pwsh
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
if (!(Get-PSRepository)) {
|
|
Register-PSRepository -Default
|
|
}
|
|
|
|
if (!(Get-Module PSScriptAnalyzer -ListAvailable)) {
|
|
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
|
|
}
|
|
|
|
Invoke-ScriptAnalyzer *.ps1 -EnableExit
|
|
|
|
$IsWin = if ($PSVersionTable.PSVersion.Major -lt 6) {
|
|
$true
|
|
} else {
|
|
$IsWindows
|
|
}
|
|
|
|
.\install.ps1 v0.2.0
|
|
$DenoVersion = if ($IsWin) {
|
|
deno --version
|
|
} else {
|
|
~/.deno/bin/deno --version
|
|
}
|
|
if (!($DenoVersion[0] -eq 'deno: 0.2.0')) {
|
|
throw $DenoVersion
|
|
} else {
|
|
Write-Output $DenoVersion
|
|
}
|
|
|
|
.\install.ps1
|
|
$DenoVersion = if ($IsWin) {
|
|
deno --version
|
|
} else {
|
|
~/.deno/bin/deno --version
|
|
}
|
|
if (!($DenoVersion[0] -match 'deno: \d+\.\d+\.\d+')) {
|
|
throw $DenoVersion
|
|
} else {
|
|
Write-Output $DenoVersion
|
|
}
|