init repo

This commit is contained in:
2026-04-25 21:50:03 +08:00
commit ada92373c2
124 changed files with 5292 additions and 0 deletions

21
run-export.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# 店小秘自动导出 - cron 启动脚本
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
export HOME="/Users/kangwan"
cd /Users/kangwan/Projects/business/20260324-店小秘自动导出
# 加载 nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
# 运行导出
node export.mjs >> export.log 2>&1
EXIT_CODE=$?
# 如果失败Cookie 过期),弹系统通知
if [ $EXIT_CODE -ne 0 ]; then
osascript -e 'display notification "Cookie 已过期,请运行 node login.mjs 重新登录" with title "店小秘自动导出" sound name "Basso"'
echo "[$(date '+%Y/%m/%d %H:%M:%S')] ✗ 导出失败Cookie 可能过期" >> export.log
fi