build only when needed
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user