chore: adapt workspace helper scripts
This commit is contained in:
parent
eb6d9a51a8
commit
428933a3d0
3 changed files with 52 additions and 9 deletions
18
bin/build
18
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
|
||||
|
|
|
|||
18
bin/lint
18
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
|
||||
|
|
|
|||
25
bin/test
25
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue