🐛 Compatible with downloading and using actions.
This commit is contained in:
3
bin/helpers/rust.ts
vendored
3
bin/helpers/rust.ts
vendored
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user