copilot login
This commit is contained in:
@@ -100,7 +100,7 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq \
|
||||
curl wget git build-essential pkg-config libssl-dev \
|
||||
ca-certificates gnupg lsb-release unzip python3
|
||||
ca-certificates gnupg lsb-release unzip python3 wslu
|
||||
log "系统依赖安装完成"
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
@@ -144,7 +144,7 @@ else
|
||||
log "安装 GitHub CLI..."
|
||||
sudo mkdir -p -m 755 /etc/apt/keyrings
|
||||
if [ ! -f /etc/apt/keyrings/githubcli-archive-keyring.gpg ]; then
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||
curl -fsSL --connect-timeout 20 --max-time 30 https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||
| sudo dd of=/etc/apt/keyrings/githubcli-archive-keyring.gpg status=none
|
||||
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
|
||||
fi
|
||||
@@ -152,9 +152,12 @@ else
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
|
||||
| sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
||||
fi
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq gh
|
||||
log "GitHub CLI 安装完成: $(gh --version 2>/dev/null | head -1)"
|
||||
if sudo apt-get update -qq -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 2>/dev/null && \
|
||||
sudo apt-get install -y -qq -o Acquire::http::Timeout=30 gh 2>/dev/null; then
|
||||
log "GitHub CLI 安装完成: $(gh --version 2>/dev/null | head -1)"
|
||||
else
|
||||
warn "GitHub CLI 安装失败(网络超时),跳过;后续可手动安装:sudo apt install gh"
|
||||
fi
|
||||
fi
|
||||
|
||||
if gh extension list 2>/dev/null | grep -q 'github/gh-copilot'; then
|
||||
|
||||
Reference in New Issue
Block a user