build only when needed

This commit is contained in:
2025-11-21 10:49:49 +02:00
parent ecd872540d
commit 48c9735d71

View File

@@ -1,2 +1,21 @@
watchexec --debounce 2s -w . "npm run build && sh local-remote.sh"
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'