From ff1cd244d6756700589883e87411242642cff679 Mon Sep 17 00:00:00 2001 From: Earl Grant Reyes Date: Mon, 20 Jan 2025 23:37:59 +0800 Subject: [PATCH 1/2] fix: fix Dart code generation --- scripts/generate_dart_codes.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/generate_dart_codes.sh b/scripts/generate_dart_codes.sh index 2b4f2301b..829601d9a 100755 --- a/scripts/generate_dart_codes.sh +++ b/scripts/generate_dart_codes.sh @@ -7,20 +7,34 @@ if [[ $# -gt 0 ]]; then fi if [ ! -d "$ROOT_DIR" ]; then - echo "Error: Directory $ROOT_DIR does not exist." + echo "\033[1;31mError: Directory $ROOT_DIR does not exist.\033[0m" exit 1 fi for dir in "$ROOT_DIR"/*/; do if [ -f "$dir/pubspec.yaml" ]; then - echo "Found package in $dir" - echo "Running dart pub get in $dir" + echo "\033[1;32m====== Found package in $dir ======\033[0m" + + echo "\033[1;34mRunning dart pub get in $dir\033[0m" (cd "$dir" && dart pub get) - echo "Running build_runner in $dir" + + echo "\033[1;34mRunning build_runner in $dir\033[0m" (cd "$dir" && dart run build_runner build --delete-conflicting-outputs) + + if [ $? -ne 0 ]; then + echo "\033[1;31mError during build_runner in $dir.\033[0m" + echo "\033[1;33mRunning dart pub upgrade in $dir...\033[0m" + + (cd "$dir" && dart pub upgrade) + + echo "\033[1;34mRetrying build_runner in $dir after upgrading...\033[0m" + (cd "$dir" && dart run build_runner build --delete-conflicting-outputs) + fi + + echo "\033[1;33mFinished processing $dir\033[0m" else - echo "No pubspec.yaml found in $dir" + echo "\033[1;31mNo pubspec.yaml found in $dir\033[0m" fi done -echo "All packages processed." +echo "\033[1;32m======== All packages processed. ========\033[0m" From a0c0ffdbdd6357896f4c6ecc8551f640e2a7a3d3 Mon Sep 17 00:00:00 2001 From: Earl Grant Reyes Date: Tue, 21 Jan 2025 00:45:26 +0800 Subject: [PATCH 2/2] chore: test signed commit --- scripts/generate_dart_codes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_dart_codes.sh b/scripts/generate_dart_codes.sh index 829601d9a..2bbc6fd26 100755 --- a/scripts/generate_dart_codes.sh +++ b/scripts/generate_dart_codes.sh @@ -22,7 +22,7 @@ for dir in "$ROOT_DIR"/*/; do (cd "$dir" && dart run build_runner build --delete-conflicting-outputs) if [ $? -ne 0 ]; then - echo "\033[1;31mError during build_runner in $dir.\033[0m" + echo "\033[1;31mError during build_runner in $dir\033[0m" echo "\033[1;33mRunning dart pub upgrade in $dir...\033[0m" (cd "$dir" && dart pub upgrade)