2023-09-02 08:17:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
. "$(dirname -- "$0")/_/husky.sh"
|
|
|
|
|
|
|
|
changed_files=$(git diff --name-only HEAD~1)
|
|
|
|
|
2023-09-03 13:20:30 +00:00
|
|
|
web_changed=$(echo "$changed_files" | grep -E '^web/' || true)
|
|
|
|
space_changed=$(echo "$changed_files" | grep -E '^space/' || true)
|
|
|
|
echo $web_changed
|
2023-09-02 08:17:21 +00:00
|
|
|
echo $space_changed
|
|
|
|
|
2023-09-03 13:20:30 +00:00
|
|
|
if [ -n "$web_changed" ] && [ -n "$space_changed" ]; then
|
|
|
|
echo "Changes detected in both web and space. Building..."
|
2023-09-02 08:17:21 +00:00
|
|
|
yarn run lint
|
|
|
|
yarn run build
|
2023-09-03 13:20:30 +00:00
|
|
|
elif [ -n "$web_changed" ]; then
|
|
|
|
echo "Changes detected in web app. Building..."
|
|
|
|
yarn run lint --filter=web
|
|
|
|
yarn run build --filter=web
|
2023-09-02 08:17:21 +00:00
|
|
|
elif [ -n "$space_changed" ]; then
|
2023-09-03 13:20:30 +00:00
|
|
|
echo "Changes detected in space app. Building..."
|
2023-09-02 08:17:21 +00:00
|
|
|
yarn run lint --filter=space
|
|
|
|
yarn run build --filter=space
|
|
|
|
fi
|