#!/bin/sh echo "*****eclint fix******" before=$(git ls-files --others --modified --deleted --exclude-standard | wc -l) echo "before: $before" dotnet format whitespace err=$? case $err in 0) echo success ;; 1) echo fail ;; 2) echo "unexpected failure" ;; *) echo "I never thought this would happen" ;; esac if [ $err -ne 0 ]; then exit $err fi after=$(git ls-files --others --modified --deleted --exclude-standard | wc -l) echo "after: $after" if [ $after -gt $before ]; then files=$(git ls-files --others --modified --deleted --exclude-standard) echo "Files not formatted correctly: $files" exit 1 fi exit $err