From 98ad56a0b2f3454ae20d307957c74b259ac70b01 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sat, 15 Feb 2020 15:28:12 +0700 Subject: [PATCH] Small script style fixes (#16) --- linux/build.ps1 | 2 +- linux/install.ps1 | 5 +++-- macos/build.ps1 | 2 +- macos/install.ps1 | 1 + windows/build.ps1 | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/linux/build.ps1 b/linux/build.ps1 index 5cecb0f..5f84f36 100644 --- a/linux/build.ps1 +++ b/linux/build.ps1 @@ -1,5 +1,5 @@ param ( - $td = "$PSScriptRoot/../td" + [string] $td = "$PSScriptRoot/../td" ) $ErrorActionPreference = 'Stop' diff --git a/linux/install.ps1 b/linux/install.ps1 index cdc00cc..6f86c6c 100644 --- a/linux/install.ps1 +++ b/linux/install.ps1 @@ -1,6 +1,6 @@ param ( - $NuGetDownloadUrl = 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', - $NuGetPath = "$PSScriptRoot/../tools/nuget.exe" + [string] $NuGetDownloadUrl = 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', + [string] $NuGetPath = "$PSScriptRoot/../tools/nuget.exe" ) $ErrorActionPreference = 'Stop' @@ -16,3 +16,4 @@ Invoke-WebRequest -OutFile $NuGetPath $NuGetDownloadUrl Write-Output 'Updating the Git submobules' git submodule update --init --recursive +if (!$?) { throw 'Cannot update the Git submodules' } diff --git a/macos/build.ps1 b/macos/build.ps1 index 40ab57f..6deb0dd 100644 --- a/macos/build.ps1 +++ b/macos/build.ps1 @@ -1,5 +1,5 @@ param ( - $td = "$PSScriptRoot/../td" + [string] $td = "$PSScriptRoot/../td" ) $ErrorActionPreference = 'Stop' diff --git a/macos/install.ps1 b/macos/install.ps1 index 39edf78..dfc862d 100644 --- a/macos/install.ps1 +++ b/macos/install.ps1 @@ -1,4 +1,5 @@ $ErrorActionPreference = 'Stop' +Set-StrictMode -Version Latest brew install gperf nuget openssl if (!$?) { throw 'Cannot install dependencies from brew' } diff --git a/windows/build.ps1 b/windows/build.ps1 index 6a05017..9794d1b 100644 --- a/windows/build.ps1 +++ b/windows/build.ps1 @@ -1,7 +1,7 @@ param ( - $td = "$PSScriptRoot/../td", - $Platform = 'x64-windows', - [Parameter(Mandatory = $true)] $VcpkgToolchain + [string] $td = "$PSScriptRoot/../td", + [string] $Platform = 'x64-windows', + [Parameter(Mandatory = $true)] [string] $VcpkgToolchain ) $ErrorActionPreference = 'Stop'