Last active
July 12, 2023 15:24
-
-
Save trueheart78/223b2874bd495b6c9d73befd3a1aa416 to your computer and use it in GitHub Desktop.
Kitty version checker πββ¬
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "colorize" | |
installed_version = `kitty --version`.match(%r:(\d+\.\d+\.\d+):)[1] | |
# => "0.28.1" | |
constants_py = `curl --silent https://raw.githubusercontent.com/kovidgoyal/kitty/master/kitty/constants.py` | |
current_version = constants_py.match(%r:Version\((\d+, \d+, \d+)\)$:)[1].split(',').map(&:to_i).join('.') | |
# => "0.28.1" | |
if installed_version != current_version | |
puts "=> New kitty version available! (v#{current_version}) [installed: v#{installed_version}] π".light_blue | |
puts "=> Changelog: https://sw.kovidgoyal.net/kitty/changelog/".light_blue | |
else | |
puts "=> Kitty is up to date! (v#{installed_version}) π".blue | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment