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)) {
73
73
$version = Invoke-WebRequest - UseBasicParsing https:// api.github.com / repos/ rust- lang/ rustlings/ releases/ latest `
74
74
| ConvertFrom-Json | Select-Object - ExpandProperty tag_name
75
75
76
+ Write-Host " Checking out version $version ..."
77
+ Set-Location $path
78
+ git checkout - q tags/ $version
79
+
76
80
Write-Host " Installing the 'rustlings' executable..."
77
- cargo install -- force -- git https: // github.com / rust - lang / rustlings -- tag $version
81
+ cargo install -- force -- path .
78
82
if (! (Get-Command rustlings - ErrorAction SilentlyContinue)) {
79
83
Write-Host " WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
80
84
}
Original file line number Diff line number Diff line change 82
82
echo " SUCCESS: Rust is up to date"
83
83
fi
84
84
85
+ Path=${1:- rustlings/ }
86
+ echo " Cloning Rustlings at $Path ..."
87
+ git clone -q https://github.com/rust-lang/rustlings $Path
88
+
85
89
Version=$( 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']);" )
86
90
CargoBin=" ${CARGO_HOME:- $HOME / .cargo} /bin"
87
91
92
+ echo " Checking out version $Version ..."
93
+ cd $Path
94
+ git checkout -q tags/$Version
95
+
88
96
echo " Installing the 'rustlings' executable..."
89
- cargo install --force --git https://github.com/rust-lang/rustlings --tag $Version
97
+ cargo install --force --path .
90
98
91
99
if ! [ -x " $( command -v rustlings) " ]
92
100
then
You can’t perform that action at this time.
0 commit comments