mirror of
https://github.com/danbulant/deno_install
synced 2026-06-11 18:51:10 +00:00
Also remove support for non-windows in powershell. I'm very sure no one uses it, it complicates the script, I don't care to maintain it.
31 lines
857 B
PowerShell
Executable file
31 lines
857 B
PowerShell
Executable file
#!/usr/bin/env pwsh
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
if (!(Get-PSRepository)) {
|
|
Register-PSRepository -Default
|
|
}
|
|
|
|
if (!(Get-Module PSScriptAnalyzer -ListAvailable)) {
|
|
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
|
|
}
|
|
|
|
# Lint.
|
|
Invoke-ScriptAnalyzer *.ps1 -EnableExit -Exclude PSAvoidAssignmentToAutomaticVariable
|
|
|
|
# Test that we can install the latest version at the default location.
|
|
Remove-Item "~\.deno" -Recurse -Force -ErrorAction SilentlyContinue
|
|
$env:DENO_INSTALL = ""
|
|
.\install.ps1
|
|
~\.deno\bin\deno.exe --version
|
|
|
|
# Test that we can install a specific version at a custom location.
|
|
Remove-Item "~\deno-0.38.0" -Recurse -Force -ErrorAction SilentlyContinue
|
|
$env:DENO_INSTALL = "$Home\deno-0.38.0"
|
|
|
|
.\install.ps1 v0.38.0
|
|
$DenoVersion = ~\deno-0.38.0\bin\deno.exe --version
|
|
|
|
if (!($DenoVersion -like '*0.38.0*')) {
|
|
throw $DenoVersion
|
|
}
|