diff options
author | Adeel Mujahid <3840695+am11@users.noreply.github.com> | 2021-12-01 02:32:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 02:32:39 +0300 |
commit | 6cc2d2e47825033c37784faa3d4e1445e5e20b42 (patch) | |
tree | 59f1e83ad1622ee2ef36784ebb4ac15104f0b43a /eng/build.sh | |
parent | 7eb5d98fac2423941cc487658dcfeb5ef1ea82b0 (diff) |
Fix a few syntax issues in shell scripts (#62102)
* Fix a few syntax issues in shell scripts
* Cleanup trailing whitespace in changed files
```sh
# git remote add dotnet https://github.com/dotnet/runtime && git pull --rebase dotnet main
if uname 2>/devnull | grep -q Darwin; then
space=" "
fi
git show --name-only --pretty="" HEAD...dotnet/main |\
xargs -I{} sh -c "test -f {} && sed -i$space'' 's/[[:space:]]*$//' {}"
```
* Address CR feedback
Diffstat (limited to 'eng/build.sh')
-rwxr-xr-x | eng/build.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/eng/build.sh b/eng/build.sh index b7e30ebef5d..f1ef5958fdb 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -166,7 +166,7 @@ while [[ $# > 0 ]]; do opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" if [[ $firstArgumentChecked -eq 0 && $opt =~ ^[a-zA-Z.+]+$ ]]; then - if [ $opt == "help" ]; then + if [[ "$opt" == "help" ]]; then showSubsetHelp exit 0 fi @@ -190,7 +190,7 @@ while [[ $# > 0 ]]; do exit 0 else passedSubset="$(echo "$2" | tr "[:upper:]" "[:lower:]")" - if [ $passedSubset == "help" ]; then + if [[ "$passedSubset" == "help" ]]; then showSubsetHelp exit 0 fi @@ -461,7 +461,7 @@ if [ ${#actInt[@]} -eq 0 ]; then arguments="-restore -build $arguments" fi -if [ "$os" = "Browser" ] && [ "$arch" != "wasm" ]; then +if [[ "$os" == "Browser" && "$arch" != "wasm" ]]; then # override default arch for Browser, we only support wasm arch=wasm fi |