Created
July 12, 2019 08:35
-
-
Save craigiswayne/952c3f11fb45e8bf9eb8232bb6c84795 to your computer and use it in GitHub Desktop.
Revisions
-
craigiswayne created this gist
Jul 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/bin/bash ########################################################################################### # Find's All *.csproj files in a directory # then executes a dotnet build on that project # if the build fails, it will stop the script execution ########################################################################################### separator="==============================================================================="; search="*.csproj" startingDirectory=$PWD; echo $separator; echo "Finding all $search files in $PWD..."; echo $separator; filesFound=$(find "$PWD" -name $search -type f); for i in $filesFound do filename=$(basename $i); echo "Building $filename..." echo ""; cd $(dirname $i); dotnet build; result=$?; echo "Result: $result"; echo ""; if [ $result -gt 0 ] then echo "Failed to build $i"; cd $startingDirectory; break; fi echo $separator; done