deno_install/install_test.ps1
Ryan Dahl b635b52584
Use new LLVM target triple filenames (#99)
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.
2020-03-31 11:47:44 -04:00

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
}