39 Star 129 Fork 0

Gitee 极速下载 / rust

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/rust-lang/rust
克隆/下载
x.ps1 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
jyn 提交于 2023-12-09 09:43 . use & instead of start-process in x.ps1
#!/usr/bin/env pwsh
# See ./x for why these scripts exist.
$ErrorActionPreference = "Stop"
# syntax check
Get-Command -syntax ${PSCommandPath} >$null
$xpy = Join-Path $PSScriptRoot x.py
$xpy_args = @($xpy) + $args
function Get-Application($app) {
$cmd = Get-Command $app -ErrorAction SilentlyContinue -CommandType Application | Select-Object -First 1
return $cmd
}
function Invoke-Application($application, $arguments) {
& $application $arguments
Exit $LASTEXITCODE
}
foreach ($python in "py", "python3", "python", "python2") {
# NOTE: this only tests that the command exists in PATH, not that it's actually
# executable. The latter is not possible in a portable way, see
# https://github.com/PowerShell/PowerShell/issues/12625.
if (Get-Application $python) {
if ($python -eq "py") {
# Use python3, not python2
$xpy_args = @("-3") + $xpy_args
}
Invoke-Application $python $xpy_args
}
}
$found = (Get-Application "python*" | Where-Object {$_.name -match '^python[2-3]\.[0-9]+(\.exe)?$'})
if (($null -ne $found) -and ($found.Length -ge 1)) {
$python = $found[0]
Invoke-Application $python $xpy_args
}
$msg = "${PSCommandPath}: error: did not find python installed`n"
$msg += "help: consider installing it from https://www.python.org/downloads/"
Write-Error $msg -Category NotInstalled
Exit 1
Rust
1
https://gitee.com/mirrors/rust.git
git@gitee.com:mirrors/rust.git
mirrors
rust
rust
master

搜索帮助