receipt-printer/start-server.sh
Developer a9bc4edc3f feat: 完善预览功能和测试数据支持
- 修复 Mustache.js 加载问题(内联到 HTML)
- 添加所有 block 类型的渲染支持(list, table, barcode, image)
- 为每个模板添加测试数据(daily-todo, food-order, fancy-receipt, ticket-list, long-text)
- 选择模板时自动加载对应测试数据
- 添加 Schema 页面显示功能
- 添加服务器启动和监控脚本
- 更新样式支持斜体、下划线等文本样式
2026-02-16 18:33:08 +00:00

29 lines
718 B
Bash
Executable File

#!/bin/bash
# 启动 Receipt Printer 服务器并监控
PIDFILE="/tmp/receipt-printer.pid"
LOGFILE="/home/ching/.openclaw/workspace/receipt-printer/server.log"
cd /home/ching/.openclaw/workspace/receipt-printer
# 如果已有进程在运行,先停止
if [ -f "$PIDFILE" ]; then
OLD_PID=$(cat "$PIDFILE" 2>/dev/null)
if kill -0 "$OLD_PID" 2>/dev/null; then
echo "Stopping existing server (PID: $OLD_PID)..."
kill "$OLD_PID"
sleep 2
fi
fi
# 清理旧日志
> "$LOGFILE"
# 启动服务器
bun run src/server.ts >> "$LOGFILE" 2>&1 &
echo $! > "$PIDFILE"
echo "Receipt Printer Server started with PID: $!"
echo "Log file: $LOGFILE"
echo "Test: curl http://localhost:3000/health"