Skip to content

Instantly share code, notes, and snippets.

@trueheart78
Last active July 12, 2023 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trueheart78/223b2874bd495b6c9d73befd3a1aa416 to your computer and use it in GitHub Desktop.
Save trueheart78/223b2874bd495b6c9d73befd3a1aa416 to your computer and use it in GitHub Desktop.
Kitty version checker πŸˆβ€β¬›
#!/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