Files
mtc-project-sync-script/scripts/build-watch.sh

22 lines
465 B
Bash
Raw Normal View History

2025-11-19 09:53:54 +02:00
2025-11-21 10:49:49 +02:00
upload() {
sh local-remote.sh --dry-run | grep -E "(\.less|\.js|\.vue|\.css)"
if [ $? -eq 0 ]; then
echo "Changes detected in build files - running build..."
npm run build && sh local-remote.sh
else
echo "No build files changed - uploading directly..."
sh local-remote.sh
fi
}
if [ "$1" = "--upload" ]; then
upload
exit 0
fi
sh "remote-local.sh"
watchexec --debounce 2s -w . 'sh watch-build.sh --upload'