ps: Fix specifying version (#34)

This commit is contained in:
Mark Tiedemann 2019-01-24 19:51:18 +01:00 committed by Ryan Dahl
parent 7edda0f115
commit e8a3ed1159
2 changed files with 5 additions and 6 deletions

View file

@ -2,13 +2,12 @@
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
# TODO(everyone): Keep this script simple and easily auditable.
param (
[ValidatePattern('^v(\d+).(\d+).(\d+)$')]
[String] $Version
)
$ErrorActionPreference = 'Stop'
if ($args.Length -gt 0) {
$Version = $args.Get(0)
}
if ($PSVersionTable.PSVersion.Major -lt 6) {
$IsWindows = $true
$IsMacOS = $false

View file

@ -10,7 +10,7 @@ if (!(Get-Module PSScriptAnalyzer -ListAvailable)) {
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
}
Invoke-ScriptAnalyzer *.ps1 -Exclude PSAvoidAssignmentToAutomaticVariable
Invoke-ScriptAnalyzer *.ps1 -EnableExit -Exclude PSAvoidAssignmentToAutomaticVariable
if ($PSVersionTable.PSVersion.Major -lt 6) {
$IsWindows = $true