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
/huacnlee
/autocorrect
/releases
/latest | jq
-r .tag_name
)
8 update-source-version autocorrect
"${version#v}"
11 trap 'rm -rf -- "${tmp}"' EXIT
13 git clone
--depth 1 --branch "${version}" https
://github.com
/huacnlee
/autocorrect.git
"${tmp}/autocorrect"
14 cargo generate-lockfile
--manifest-path "${tmp}/autocorrect/Cargo.toml"
15 cp "${tmp}/autocorrect/Cargo.lock" "$(dirname "$0")/Cargo.lock"