diff --git a/README.md b/README.md index 072cbeb..c6d4467 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ bin/img-gen - Docker - Docker Compose - qemu-user-static -- awk, bash, curl, fallocate, grep, gzip, losetup, mkfs.fat, parted, ruby, ssh-keygen, tar, xargs +- awk, bash, curl, fallocate, grep, gzip, losetup, mkfs.fat, parted, python3, ssh-keygen, tar, xargs ### WiFi の設定 diff --git a/bin/version b/bin/version index b7ba2e5..cafa065 100755 --- a/bin/version +++ b/bin/version @@ -1,13 +1,12 @@ -#!/usr/bin/env ruby +#!/usr/bin/env python3 # 最新のバージョンを取得 # Usage: bin/version -require "open-uri" -require "yaml" +from urllib.request import urlopen +import 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") +url = f"{base}/latest-releases.yaml" +res = urlopen(url) +version = yaml.safe_load(res)[0]["version"] -puts version +print(version)