mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
babashka: add passthru.updateScript
This commit is contained in:
parent
5fa9b22eef
commit
38001b1454
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl, graalvm11-ce, glibcLocales }:
|
||||
{ lib, stdenv, fetchurl, graalvm11-ce, glibcLocales, writeScript }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "babashka";
|
||||
@ -58,6 +58,21 @@ stdenv.mkDerivation rec {
|
||||
$out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | grep '[1 2]'
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeScript "update-babashka" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl common-updater-scripts jq
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
readonly latest_version="$(curl \
|
||||
''${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
|
||||
-s "https://api.github.com/repos/babashka/babashka/releases/latest" \
|
||||
| jq -r '.tag_name')"
|
||||
|
||||
# v0.6.2 -> 0.6.2
|
||||
update-source-version babashka "''${latest_version/v/}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A Clojure babushka for the grey areas of Bash";
|
||||
longDescription = ''
|
||||
|
Loading…
Reference in New Issue
Block a user