about summary refs log tree commit diff
diff options
context:
space:
mode:
authorozkanonur <work@onurozkan.dev>2023-05-03 20:32:39 +0300
committerozkanonur <work@onurozkan.dev>2023-05-03 20:32:39 +0300
commiteea6202c248f0aa57a7f490f50a7bf21f322a40e (patch)
treea8b5b370f1d79742caa6981cc2389ac1236ad726
parent9d795a6e6e19d56b235d1dbd4f5941404cf5918c (diff)
downloadrust-eea6202c248f0aa57a7f490f50a7bf21f322a40e.tar.gz
rust-eea6202c248f0aa57a7f490f50a7bf21f322a40e.zip
check bootstrap scripts syntax
Signed-off-by: ozkanonur <work@onurozkan.dev>
-rwxr-xr-xx5
-rwxr-xr-xx.ps15
2 files changed, 9 insertions, 1 deletions
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.