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/formatting | |
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/formatting')
-rw-r--r-- | eng/formatting/format.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/eng/formatting/format.sh b/eng/formatting/format.sh index 5a9edf4c339..eb4908c078c 100644 --- a/eng/formatting/format.sh +++ b/eng/formatting/format.sh @@ -7,14 +7,14 @@ MANAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" "*.vb" | exec 1>&2 -if [[ -n "$NATIVE_FILES" ]]; then +if [ -n "$NATIVE_FILES" ]; then # Format all selected files echo "$NATIVE_FILES" | cat | xargs | sed -e 's/ /,/g' | xargs "./artifacts/tools/clang-format" -style=file -i # Add back the modified files to staging echo "$NATIVE_FILES" | xargs git add fi -if [[ -n "$MANAGED_FILES" ]]; then +if [ -n "$MANAGED_FILES" ]; then # Format all selected files echo "$MANAGED_FILES" | cat | xargs | sed -e 's/ /,/g' | dotnet format --include @@ -22,5 +22,4 @@ if [[ -n "$MANAGED_FILES" ]]; then echo "$MANAGED_FILES" | xargs git add fi - exit 0 |