From eea6202c248f0aa57a7f490f50a7bf21f322a40e Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Wed, 3 May 2023 20:32:39 +0300 Subject: [PATCH] check bootstrap scripts syntax Signed-off-by: ozkanonur --- x | 5 ++++- x.ps1 | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/x b/x index 4309b82627c..d967988e1c4 100755 --- a/x +++ b/x @@ -7,9 +7,12 @@ set -eu +# syntax check +sh -n $0 + realpath() { if [ -d "$1" ]; then - CDPATH='' command cd "$1" && pwd -P + CDPATH='' command cd "$1" && pwd -P else echo "$(realpath "$(dirname "$1")")/$(basename "$1")" fi diff --git a/x.ps1 b/x.ps1 index f324a4676c8..540fc6530e2 100755 --- a/x.ps1 +++ b/x.ps1 @@ -2,6 +2,11 @@ # See ./x for why these scripts exist. +$ErrorActionPreference = "Stop" + +# syntax check +Get-Command -syntax ${PSCommandPath} + $xpy = Join-Path $PSScriptRoot x.py # Start-Process for some reason splits arguments on spaces. (Isn't powershell supposed to be simpler than bash?) # Double-quote all the arguments so it doesn't do that.