2024-09-28 19:41:34 +01:00
|
|
|
#!/bin/sh
|
2024-10-29 12:51:04 +00:00
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
fancy() {
|
|
|
|
width="$(tput cols)"
|
|
|
|
# Create a string of spaces based on the width
|
|
|
|
spaces=$(printf '%*s' "$width" '' | tr ' ' ' ')
|
|
|
|
|
|
|
|
# Print the formatted output
|
|
|
|
printf "%b%s %s %s%s\n\033[0m" "$1" "$spaces" "$2" "$(printf '%*s' "$((width - ${#2} - 4))" '' | tr ' ' ' ')" "$spaces"
|
|
|
|
}
|
|
|
|
|
|
|
|
fancy "\033[1;106m" "Welcome to fulgens! Starting build..."
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
2024-09-28 19:41:34 +01:00
|
|
|
path=$(realpath "$(dirname "$0")") || exit 1
|
2024-10-29 12:51:04 +00:00
|
|
|
searchDir="$path/services-src"
|
|
|
|
find -L "$searchDir" -type f -name "build.sh" | while read -r buildScript; do
|
|
|
|
clear
|
|
|
|
buildDir=$(dirname "$buildScript")
|
|
|
|
fancy "\033[1;104m" "Starting build of $(basename "$buildDir")..."
|
|
|
|
(cd "$buildDir" && ./build.sh) || {
|
|
|
|
printf "\033[1;31mError: %s failed.\033[0m\n" "$buildScript"
|
2024-09-28 19:41:34 +01:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
done
|
2024-10-29 12:51:04 +00:00
|
|
|
clear
|
|
|
|
fancy "\033[1;105m" "Building Fulgens..."
|
2024-09-28 19:41:34 +01:00
|
|
|
go build --ldflags "-s -w" -o "$path/fulgens" || exit 1
|
2024-10-29 12:51:04 +00:00
|
|
|
clear
|
2024-11-14 19:48:39 +00:00
|
|
|
fancy "\033[1;102m" "Fulgens has been built successfully!"
|