evetool / scripts /install-lightpanda.sh
hunian
添加 Dockerfile、docker-compose.yml 和多个配置文件,设置 evetool 项目的基础结构
5d85019
Raw
History Blame Contribute Delete
1.19 kB
#!/usr/bin/env bash
# 下载并安装 lightpanda 二进制到 /usr/local/bin/lightpanda
# 沿用 H:/tool/message/Dockerfile 的方案: nightly release + linux/amd64
set -uo pipefail
BIN_DEST="/usr/local/bin/lightpanda"
TMPDIR_INSTALL="$(mktemp -d)"
trap 'rm -rf "$TMPDIR_INSTALL"' EXIT
ARCH="$(uname -m)"
case "$ARCH" in
x86_64|amd64) LP_BIN="lightpanda-x86_64-linux" ;;
aarch64|arm64) LP_BIN="lightpanda-aarch64-linux" ;;
*)
echo "[install-lightpanda] unsupported arch: $ARCH, skip" >&2
exit 0
;;
esac
# nightly release (与原 message 项目一致)
DOWNLOAD_URL="https://github.com/lightpanda-io/browser/releases/download/nightly/${LP_BIN}"
echo "[install-lightpanda] downloading $DOWNLOAD_URL"
if ! curl -fL --connect-timeout 10 --max-time 180 -o "${TMPDIR_INSTALL}/lightpanda" "$DOWNLOAD_URL"; then
echo "[install-lightpanda] WARN: download failed, will retry at runtime if needed" >&2
echo "[install-lightpanda] WARN: 备选 - 改用挂载 $BIN_DEST 注入" >&2
exit 0
fi
chmod +x "${TMPDIR_INSTALL}/lightpanda"
install -m 0755 "${TMPDIR_INSTALL}/lightpanda" "$BIN_DEST"
echo "[install-lightpanda] installed $BIN_DEST ($("$BIN_DEST" version 2>&1 | head -1))"