File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,12 @@ if (!($LASTEXITCODE -eq 0)) {
7373$version = Invoke-WebRequest - UseBasicParsing https:// api.github.com / repos/ rust- lang/ rustlings/ releases/ latest `
7474 | ConvertFrom-Json | Select-Object - ExpandProperty tag_name
7575
76+ Write-Host " Checking out version $version ..."
77+ Set-Location $path
78+ git checkout - q tags/ $version
79+
7680Write-Host " Installing the 'rustlings' executable..."
77- cargo install -- force -- git https: // github.com / rust - lang / rustlings -- tag $version
81+ cargo install -- force -- path .
7882if (! (Get-Command rustlings - ErrorAction SilentlyContinue)) {
7983 Write-Host " WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
8084}
Original file line number Diff line number Diff line change 8282 echo " SUCCESS: Rust is up to date"
8383fi
8484
85+ Path=${1:- rustlings/ }
86+ echo " Cloning Rustlings at $Path ..."
87+ git clone -q https://github.com/rust-lang/rustlings $Path
88+
8589Version=$( curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | python -c " import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']);" )
8690CargoBin=" ${CARGO_HOME:- $HOME / .cargo} /bin"
8791
92+ echo " Checking out version $Version ..."
93+ cd $Path
94+ git checkout -q tags/$Version
95+
8896echo " Installing the 'rustlings' executable..."
89- cargo install --force --git https://github.com/rust-lang/rustlings --tag $Version
97+ cargo install --force --path .
9098
9199if ! [ -x " $( command -v rustlings) " ]
92100then
You can’t perform that action at this time.
0 commit comments