From 318a07adf874d4472ee385089fb02c5912ba2f26 Mon Sep 17 00:00:00 2001 From: Moritz Heidkamp Date: Sun, 1 Oct 2023 16:29:58 +0200 Subject: [PATCH] clojure: improve updateScript error behavior Will now terminate e.g. when curl gets a 404 response. See https://github.com/NixOS/nixpkgs/pull/257473#issuecomment-1742095105 for more backgroud on the shell code changes. --- pkgs/development/interpreters/clojure/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix index 0008b181fec2..bc7ef5769986 100644 --- a/pkgs/development/interpreters/clojure/default.nix +++ b/pkgs/development/interpreters/clojure/default.nix @@ -61,11 +61,12 @@ stdenv.mkDerivation (finalAttrs: { #!nix-shell -i bash -p curl common-updater-scripts jq set -euo pipefail + shopt -s inherit_errexit # `jq -r '.[0].name'` results in `v0.0` - readonly latest_version="$(curl \ + latest_version="$(curl \ ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ - -s "https://api.github.com/repos/clojure/brew-install/tags" \ + -fsL "https://api.github.com/repos/clojure/brew-install/tags" \ | jq -r '.[1].name')" update-source-version clojure "$latest_version"