File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
+ set -euo pipefail
2
3
3
4
echo " Let's get you set up with Rustlings!"
4
5
@@ -100,8 +101,8 @@ function vercomp() {
100
101
101
102
RustVersion=$( rustc --version | cut -d " " -f 2)
102
103
MinRustVersion=1.39
103
- vercomp $RustVersion $MinRustVersion
104
- if [ $? -eq 2 ]
104
+ vercomp " $RustVersion " $MinRustVersion || ec= $?
105
+ if [ ${ec :- 0} -eq 2 ]
105
106
then
106
107
echo " ERROR: Rust version is too old: $RustVersion - needs at least $MinRustVersion "
107
108
echo " Please update Rust with 'rustup update'"
112
113
113
114
Path=${1:- rustlings/ }
114
115
echo " 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 "
116
117
117
- cd $Path
118
+ cd " $Path "
118
119
119
120
Version=$( 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']);" )
120
121
CargoBin=" ${CARGO_HOME:- $HOME / .cargo} /bin"
You can’t perform that action at this time.
0 commit comments