1
0
Fork 0
mirror of https://github.com/kou029w/yama.git synced 2025-01-19 00:18:06 +00:00
yama/bin/version
2020-07-21 01:34:15 +09:00

10 lines
373 B
Bash
Executable file

#!/bin/sh
# 最新のバージョンを取得
# Usage: bin/version
# Required: curl grep jq ruby
set -eu
base="http://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/armhf"
curl -s "${base}/latest-releases.yaml" \
| ruby -ryaml -rjson -e 'puts(YAML.load($<).to_json)' \
| jq -r '.[] | select(.title == "Raspberry Pi").file' \
| grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'