From 6c5ba7cc013762be48c1a72f1060979296c78e4b Mon Sep 17 00:00:00 2001 From: Mahdi Bahrami Date: Sun, 26 Feb 2023 19:30:57 +0330 Subject: [PATCH] Better error message when failing --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 19296910..4ee56bb1 100755 --- a/install.sh +++ b/install.sh @@ -141,7 +141,7 @@ git clone -q https://github.com/rust-lang/rustlings "$Path" cd "$Path" -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']);") +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']}\");") CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin" if [[ -z ${Version} ]]