chore: adapt workspace helper scripts

This commit is contained in:
toki 2026-05-21 13:39:56 +09:00
parent eb6d9a51a8
commit 428933a3d0
3 changed files with 52 additions and 9 deletions

View file

@ -4,13 +4,25 @@ set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -f "$root/services/core/go.mod" ]; then 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 fi
if [ -f "$root/apps/web/package.json" ]; then 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 fi
if [ -f "$root/apps/mobile/pubspec.yaml" ]; then 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 fi

View file

@ -4,13 +4,25 @@ set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -f "$root/services/core/go.mod" ]; then 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 fi
if [ -f "$root/apps/web/package.json" ]; then 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 fi
if [ -f "$root/apps/mobile/pubspec.yaml" ]; then 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 fi

View file

@ -4,13 +4,32 @@ set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -f "$root/services/core/go.mod" ]; then 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 fi
if [ -f "$root/apps/web/package.json" ]; then 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 fi
if [ -f "$root/apps/mobile/pubspec.yaml" ]; then 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 fi