electron-test/ubuntu22-build.sh
2025-11-22 22:41:06 +08:00

18 lines
762 B
Bash

#!/usr/bin/env bash
set -e
REPO="http://121.37.111.42:3000/ThbTech/eletron-test.git"
if [ -n "$GIT_USER" ] && [ -n "$GIT_PASS" ]; then REPO="http://$GIT_USER:$GIT_PASS@121.37.111.42:3000/ThbTech/eletron-test.git"; fi
TARGET_DIR="${TARGET_DIR:-$HOME/eletron-test}"
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