1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p coreutils curl jq common-updater-scripts cargo
3 # shellcheck shell=bash
7 version
=$
(curl
-s https
://api.github.com
/repos
/systemd
/zram-generator
/releases
/latest | jq
-r .tag_name
)
8 update-source-version zram-generator
"${version#v}"
11 trap 'rm -rf -- "${tmp}"' EXIT
13 git clone
--depth 1 --branch "${version}" https
://github.com
/systemd
/zram-generator.git
"${tmp}/zram-generator"
14 cargo generate-lockfile
--manifest-path "${tmp}/zram-generator/Cargo.toml"
15 cp "${tmp}/zram-generator/Cargo.lock" "$(dirname "$0")/Cargo.lock"