diff --git a/bin/build b/bin/build index f4a4b9d..e3c69e7 100755 --- a/bin/build +++ b/bin/build @@ -4,13 +4,25 @@ set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" if [ -f "$root/services/core/go.mod" ]; then - (cd "$root/services/core" && go build ./...) + if command -v go >/dev/null 2>&1; then + (cd "$root/services/core" && go build ./...) + else + echo "skip services/core: go not found" + fi fi if [ -f "$root/apps/web/package.json" ]; then - (cd "$root/apps/web" && npm run build) + if command -v npm >/dev/null 2>&1; then + (cd "$root/apps/web" && npm run build) + else + echo "skip apps/web: npm not found" + fi fi if [ -f "$root/apps/mobile/pubspec.yaml" ]; then - (cd "$root/apps/mobile" && flutter build web) + if command -v flutter >/dev/null 2>&1; then + (cd "$root/apps/mobile" && flutter build web) + else + echo "skip apps/mobile: flutter not found" + fi fi diff --git a/bin/lint b/bin/lint index eb73706..33f6fe3 100755 --- a/bin/lint +++ b/bin/lint @@ -4,13 +4,25 @@ set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" if [ -f "$root/services/core/go.mod" ]; then - (cd "$root/services/core" && go vet ./...) + if command -v go >/dev/null 2>&1; then + (cd "$root/services/core" && go vet ./...) + else + echo "skip services/core: go not found" + fi fi if [ -f "$root/apps/web/package.json" ]; then - (cd "$root/apps/web" && npm run lint --if-present) + if command -v npm >/dev/null 2>&1; then + (cd "$root/apps/web" && npm run lint --if-present) + else + echo "skip apps/web: npm not found" + fi fi if [ -f "$root/apps/mobile/pubspec.yaml" ]; then - (cd "$root/apps/mobile" && flutter analyze) + if command -v flutter >/dev/null 2>&1; then + (cd "$root/apps/mobile" && flutter analyze) + else + echo "skip apps/mobile: flutter not found" + fi fi diff --git a/bin/test b/bin/test index c99797a..34bce27 100755 --- a/bin/test +++ b/bin/test @@ -4,13 +4,32 @@ set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" if [ -f "$root/services/core/go.mod" ]; then - (cd "$root/services/core" && go test ./...) + if command -v go >/dev/null 2>&1; then + (cd "$root/services/core" && go test ./...) + else + echo "skip services/core: go not found" + fi fi if [ -f "$root/apps/web/package.json" ]; then - (cd "$root/apps/web" && npm test -- --run) + if command -v npm >/dev/null 2>&1; then + ( + cd "$root/apps/web" + if node -e "process.exit(require('./package.json').scripts?.test ? 0 : 1)" >/dev/null 2>&1; then + npm test -- --run + else + npm run check --if-present + fi + ) + else + echo "skip apps/web: npm not found" + fi fi if [ -f "$root/apps/mobile/pubspec.yaml" ]; then - (cd "$root/apps/mobile" && flutter test) + if command -v flutter >/dev/null 2>&1; then + (cd "$root/apps/mobile" && flutter test) + else + echo "skip apps/mobile: flutter not found" + fi fi