Skip to content

Commit 3d9b03c

Browse files
author
mokou
committed
fix: Re-add cloning the repo to install scripts
1 parent a03d965 commit 3d9b03c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

install.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
7680
Write-Host "Installing the 'rustlings' executable..."
77-
cargo install --force --git https://github.com/rust-lang/rustlings --tag $version
81+
cargo install --force --path .
7882
if (!(Get-Command rustlings -ErrorAction SilentlyContinue)) {
7983
Write-Host "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
8084
}

install.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,19 @@ else
8282
echo "SUCCESS: Rust is up to date"
8383
fi
8484

85+
Path=${1:-rustlings/}
86+
echo "Cloning Rustlings at $Path..."
87+
git clone -q https://github.com/rust-lang/rustlings $Path
88+
8589
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']);")
8690
CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin"
8791

92+
echo "Checking out version $Version..."
93+
cd $Path
94+
git checkout -q tags/$Version
95+
8896
echo "Installing the 'rustlings' executable..."
89-
cargo install --force --git https://github.com/rust-lang/rustlings --tag $Version
97+
cargo install --force --path .
9098

9199
if ! [ -x "$(command -v rustlings)" ]
92100
then

0 commit comments

Comments
 (0)