Skip to content

Commit 2f34370

Browse files
authored
Merge pull request #1402 from MahdiBM/patch-1
Better error message when failing
2 parents 94799b1 + 6c5ba7c commit 2f34370

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ git clone -q https://github.com/rust-lang/rustlings "$Path"
141141

142142
cd "$Path"
143143

144-
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']);")
144+
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']) if 'tag_name' in obj else sys.exit(f\"Error: {obj['message']}\");")
145145
CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin"
146146

147147
if [[ -z ${Version} ]]

0 commit comments

Comments
 (0)