megabit-os/bin/version

13 lines
311 B
Ruby
Executable file

#!/usr/bin/env ruby
# 最新のバージョンを取得
# Usage: bin/version
require "open-uri"
require "yaml"
base = "http://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/armhf"
url = "#{base}/latest-releases.yaml"
io = URI.open(url)
yaml = YAML.load(io)
version = yaml.dig(0, "version")
puts version