🐛 Compatible with downloading and using actions.

This commit is contained in:
Tw93
2023-07-21 09:23:55 +08:00
parent e314842482
commit 0a607f509a
5 changed files with 8 additions and 6 deletions

3
bin/helpers/rust.ts vendored
View File

@@ -7,8 +7,9 @@ import { shellExec } from '@/utils/shell';
import { isChinaDomain } from '@/utils/ip';
export async function installRust() {
const isActions = process.env.GITHUB_ACTIONS;
const isInChina = await isChinaDomain('sh.rustup.rs');
const rustInstallScriptForMac = isInChina
const rustInstallScriptForMac = isInChina && !isActions
? 'export RUSTUP_DIST_SERVER="https://rsproxy.cn" && export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" && curl --proto "=https" --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh'
: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y";
const rustInstallScriptForWindows = 'winget install --id Rustlang.Rustup';