babashka: add passthru.updateScript
This commit is contained in:
parent
5fa9b22eef
commit
38001b1454
1 changed files with 16 additions and 1 deletions
|
@ -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 a new issue