Merge branch 'fix-go-version-check' of https://github.com/Maytha8/kitty

This commit is contained in:
Kovid Goyal 2024-01-19 20:22:42 +05:30
commit c7d894d499
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -971,7 +971,7 @@ def build_static_kittens(
go = shutil.which('go')
if not go:
raise SystemExit('The go tool was not found on this system. Install Go')
required_go_version = subprocess.check_output([go] + 'list -f {{.GoVersion}} -m'.split()).decode().strip()
required_go_version = subprocess.check_output([go] + 'list -f {{.GoVersion}} -m'.split(), env=dict(os.environ, GO111MODULE="on")).decode().strip()
current_go_version = subprocess.check_output([go, 'version']).decode().strip().split()[2][2:]
if parse_go_version(required_go_version) > parse_go_version(current_go_version):
raise SystemExit(f'The version of go on this system ({current_go_version}) is too old. go >= {required_go_version} is needed')