electron-test/ubuntu22-build.sh

18 lines
766 B
Bash
Raw Normal View History

2025-11-22 22:41:06 +08:00
#!/usr/bin/env bash
set -e
2025-11-22 22:48:14 +08:00
REPO="http://121.37.111.42:3000/ThbTech/electron-test.git"
if [ -n "$GIT_USER" ] && [ -n "$GIT_PASS" ]; then REPO="http://$GIT_USER:$GIT_PASS@121.37.111.42:3000/ThbTech/electron-test.git"; fi
TARGET_DIR="${TARGET_DIR:-$HOME/electron-test}"
2025-11-22 22:41:06 +08:00
BRANCH="${BRANCH:-main}"
export ELECTRON_MIRROR="${ELECTRON_MIRROR:-https://npmmirror.com/mirrors/electron/}"
sudo apt update
sudo apt install -y git curl build-essential libarchive-tools rpm xz-utils libfuse2
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm i -g cnpm --registry=https://registry.npmmirror.com
rm -rf "$TARGET_DIR"
git clone "$REPO" "$TARGET_DIR"
cd "$TARGET_DIR"
git checkout "$BRANCH" || true
cnpm install
cnpm run build:linux