File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ set -euo pipefail
23
34echo " Let's get you set up with Rustlings!"
45
@@ -100,8 +101,8 @@ function vercomp() {
100101
101102RustVersion=$( rustc --version | cut -d " " -f 2)
102103MinRustVersion=1.39
103- vercomp $RustVersion $MinRustVersion
104- if [ $? -eq 2 ]
104+ vercomp " $RustVersion " $MinRustVersion || ec= $?
105+ if [ ${ec :- 0} -eq 2 ]
105106then
106107 echo " ERROR: Rust version is too old: $RustVersion - needs at least $MinRustVersion "
107108 echo " Please update Rust with 'rustup update'"
112113
113114Path=${1:- rustlings/ }
114115echo " Cloning Rustlings at $Path ..."
115- git clone -q https://github.com/rust-lang/rustlings $Path
116+ git clone -q https://github.com/rust-lang/rustlings " $Path "
116117
117- cd $Path
118+ cd " $Path "
118119
119120Version=$( curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | ${PY} -c " import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']);" )
120121CargoBin=" ${CARGO_HOME:- $HOME / .cargo} /bin"
You can’t perform that action at this time.
0 commit comments