Skip to content

Commit

Permalink
fix: Re-add cloning the repo to install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mokou committed Feb 27, 2020
1 parent a03d965 commit 3d9b03c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ if (!($LASTEXITCODE -eq 0)) {
$version = Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/rust-lang/rustlings/releases/latest `
| ConvertFrom-Json | Select-Object -ExpandProperty tag_name

Write-Host "Checking out version $version..."
Set-Location $path
git checkout -q tags/$version

Write-Host "Installing the 'rustlings' executable..."
cargo install --force --git https://github.com/rust-lang/rustlings --tag $version
cargo install --force --path .
if (!(Get-Command rustlings -ErrorAction SilentlyContinue)) {
Write-Host "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
}
Expand Down
10 changes: 9 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,19 @@ else
echo "SUCCESS: Rust is up to date"
fi

Path=${1:-rustlings/}
echo "Cloning Rustlings at $Path..."
git clone -q https://github.com/rust-lang/rustlings $Path

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']);")
CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin"

echo "Checking out version $Version..."
cd $Path
git checkout -q tags/$Version

echo "Installing the 'rustlings' executable..."
cargo install --force --git https://github.com/rust-lang/rustlings --tag $Version
cargo install --force --path .

if ! [ -x "$(command -v rustlings)" ]
then
Expand Down

0 comments on commit 3d9b03c

Please sign in to comment.