update at 2025-09-22 19:29:18
This commit is contained in:
19
build.sh
Executable file
19
build.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e # 出错立即退出
|
||||
|
||||
# 1. 构建
|
||||
npm run build
|
||||
|
||||
# 2. 目标路径
|
||||
TARGET=~/myweb/.obsidian/plugins/note-to-mp/main.js
|
||||
BACKUP=~/myweb/.obsidian/plugins/note-to-mp/main.js.bk
|
||||
|
||||
# 3. 如果存在 main.js,先备份
|
||||
if [ -f "$TARGET" ]; then
|
||||
cp -f "$TARGET" "$BACKUP"
|
||||
echo "已备份 $TARGET -> $BACKUP"
|
||||
fi
|
||||
|
||||
# 4. 覆盖复制新的 main.js
|
||||
cp -f main.js "$TARGET"
|
||||
echo "已更新 $TARGET"
|
||||
Reference in New Issue
Block a user