The five src/*/install.ab files are ~90% identical: read the VERSION param, ensure packages (plus jq/curl for latest), resolve the latest version, set up a temp dir, download/verify/extract/install, clean up. Only the artifact filename/URL templates and a few package extras differ.
A shared helper in lib/ (taking e.g. binary name, resolved version, download URL, and an optional checksum source) would collapse each feature to a short config + call, and prevent the drift that already happened (gleam gained checksum verification while just didn't, see the checksum issue).
Related: PR #33 already consolidates the latest-version lookup — this issue is the same idea applied to the rest of the install flow, and should build on top of it.
The five
src/*/install.abfiles are ~90% identical: read theVERSIONparam, ensure packages (plusjq/curlforlatest), resolve the latest version, set up a temp dir, download/verify/extract/install, clean up. Only the artifact filename/URL templates and a few package extras differ.A shared helper in
lib/(taking e.g. binary name, resolved version, download URL, and an optional checksum source) would collapse each feature to a short config + call, and prevent the drift that already happened (gleam gained checksum verification while just didn't, see the checksum issue).Related: PR #33 already consolidates the latest-version lookup — this issue is the same idea applied to the rest of the install flow, and should build on top of it.