mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Get go version from go.mod
No need to update multiple places when bumping the go version.
This commit is contained in:
@@ -106,8 +106,17 @@ rst_prolog = '''
|
||||
'''.replace('VERSION', str_version)
|
||||
smartquotes_action = 'qe' # educate quotes and ellipses but not dashes
|
||||
|
||||
def go_version(go_mod_path: str) -> str: # {{{
|
||||
with open(go_mod_path) as f:
|
||||
for line in f:
|
||||
if line.startswith('go '):
|
||||
return line.strip().split()[1]
|
||||
raise SystemExit(f'No Go version in {go_mod_path}')
|
||||
# }}}
|
||||
|
||||
string_replacements = {
|
||||
'_kitty_install_cmd': 'curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin',
|
||||
'_build_go_version': go_version('../go.mod'),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user