Files
RedisClipSync/linux/build-and-run.sh

26 lines
715 B
Bash
Raw Permalink 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.
#!/usr/bin/env bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_ROOT"
echo "========================================"
echo " Redis 剪切板同步 - 一键打包并运行"
echo "========================================"
echo
echo "[1/2] 正在打包..."
if ! mvn -f code/pom.xml -q clean package -DskipTests; then
echo "打包失败,请确保已安装 Maven 且可执行 mvn。"
exit 1
fi
echo "打包完成: code/target/redis-clip-sync.jar"
echo
CONFIG="${1:-config.properties}"
echo "[2/2] 正在启动(配置文件: $CONFIG..."
echo "提示: 按 Ctrl+C 可退出程序"
echo
exec java -jar code/target/redis-clip-sync.jar "$CONFIG"