Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
script: use tuna mirror for rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
howardlau1999 authored Apr 29, 2024
1 parent 91dd2d8 commit 3288357
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions install_typst.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Install Rustup with Powershell
$OutputEncoding = [System.Text.Encoding]::UTF8

# Use TUNA rustup mirror
$Env:RUSTUP_DIST_SERVER = "https://mirrors.tuna.tsinghua.edu.cn/rustup"

# Check if Rust is already installed
if (Get-Command cargo -ErrorAction SilentlyContinue) {
Write-Output "检测到 Rust 已安装,尝试更新。"
Expand All @@ -13,8 +16,7 @@ else {

# Run the installer
Write-Output "运行 Rustup 安装程序..."
$Env:RUSTUP_DIST_SERVER = "https://mirrors.tuna.tsinghua.edu.cn/rustup"
Start-Process —FilePath $Env:Temp/rustup-init.exe -Args -y
Start-Process -FilePath $Env:Temp/rustup-init.exe -Args -y

# Add Rustup to the PATH
Write-Output "将 Rustup 添加到 PATH 环境变量..."
Expand Down

0 comments on commit 3288357

Please sign in to comment.