Files
note2any/build.sh
2025-09-22 19:29:18 +08:00

20 lines
410 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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"