forked from hypar-io/BuildingBlocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-all.sh
36 lines (29 loc) · 850 Bytes
/
build-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Find all hypar.json files and store their paths in an array
file_paths=($(find -name 'hypar.json'))
# Array to store failed directories
failed_directories=()
# Iterate through each file path
for file_path in "${file_paths[@]}"; do
# Get the directory containing the hypar.json file
directory=$(dirname "$file_path")
# Change to the directory
cd "$directory" || exit
# Run dotnet build
if ! dotnet build; then
# Add the failed directory to the array
failed_directories+=("$directory")
fi
# Change back to the original directory
cd - || exit
done
# Check if there are any failed directories
if [ ${#failed_directories[@]} -eq 0 ]; then
echo "All builds successful"
else
echo "Failed directories:"
for failed_directory in "${failed_directories[@]}"; do
echo "$failed_directory"
done
exit 1
fi