纳入 track-uniapp 前端项目 (扫码/任务树/记录/转交Picker)
This commit is contained in:
29
track-uniapp/sync-watch.sh
Normal file
29
track-uniapp/sync-watch.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# uni-app 双向同步脚本
|
||||
# WSL ←→ Windows G 盘,两边改代码互相跟随
|
||||
# 用法: bash sync-watch.sh 停止: Ctrl+C
|
||||
# ============================================================
|
||||
|
||||
SRC="/home/yueli/track/track-uniapp"
|
||||
DST="/mnt/g/Track/track-app/track"
|
||||
|
||||
EXCLUDES="--exclude node_modules --exclude .git --exclude dist --exclude unpackage --exclude .hbuilderx --exclude package.json --exclude package-lock.json --exclude vite.config.ts --exclude uni.scss --exclude uni.promisify.adaptor.js"
|
||||
|
||||
do_sync() {
|
||||
rsync -av $EXCLUDES "$SRC/" "$DST/" 2>/dev/null
|
||||
sleep 0.5
|
||||
rsync -av $EXCLUDES "$DST/" "$SRC/" 2>/dev/null
|
||||
}
|
||||
|
||||
echo "🔁 双向同步 $SRC ↔ $DST"
|
||||
echo " 按 Ctrl+C 停止"
|
||||
do_sync
|
||||
echo "✅ 首次同步完成,开始监听..."
|
||||
|
||||
inotifywait -m -r -e modify,create,delete,move \
|
||||
--exclude 'node_modules|.git|dist|unpackage|.hbuilderx' \
|
||||
"$SRC" 2>/dev/null | while read -r dir action file; do
|
||||
do_sync
|
||||
echo " ↻ $(date +%H:%M:%S) 已同步"
|
||||
done
|
||||
Reference in New Issue
Block a user