diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2022-12-23 12:07:30 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2022-12-23 12:07:30 +0100 |
commit | b867c5dc0097b09a75705d616cc10f65c3d60ffb (patch) | |
tree | d3b76b97b2639621926a715927975055992e85a4 /bin/age | |
parent | 9572ac5ffbb869f59f354303556f90e86bd67bcc (diff) | |
download | infra-b867c5dc0097b09a75705d616cc10f65c3d60ffb.tar.gz infra-b867c5dc0097b09a75705d616cc10f65c3d60ffb.tar.bz2 infra-b867c5dc0097b09a75705d616cc10f65c3d60ffb.tar.xz infra-b867c5dc0097b09a75705d616cc10f65c3d60ffb.zip |
knot pdb
Diffstat (limited to 'bin/age')
-rwxr-xr-x | bin/age | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +#!/bin/bash + +set -euo pipefail + +v=1.0.0 + +basedir="${0%/*}" +self="${0##*/}" + +s=$(uname -s) +case "$s" +in + Darwin) s=darwin ;; + Linux) s=linux ;; + *) echo "Unsupported system: $s" >/dev/stderr; exit 1 ;; +esac + +m=$(uname -m) +case "$m" +in + x86_64) m=amd64 ;; + arm64) ;; + *) echo "Unsupported machine: $m" >/dev/stderr; exit 1 ;; +esac + +url=https://github.com/FiloSottile/age/releases/download/v${v}/age-v${v}-${s}-${m}.tar.gz + +tar="$basedir/.age/age-${v}.tar.gz" +bin="${tar%.tar.gz}/age/$self" + +if [[ ! -x "$bin" ]] +then + mkdir -p "${tar%/*}" + wget -O "$tar" "$url" + + mkdir -p "${tar%.tar.gz}" + tar xf "$tar" -C "${tar%.tar.gz}" + chmod +x "$bin" +fi + +exec "$bin" "${@}" |