mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 07:24:41 +02:00
Nicer error when go is not found during build
This commit is contained in:
6
setup.py
6
setup.py
@@ -876,12 +876,16 @@ def safe_makedirs(path: str) -> None:
|
||||
|
||||
|
||||
def build_kitty_tool(args: Options, launcher_dir: str = '.') -> None:
|
||||
cmd = ['go', 'build']
|
||||
go = shutil.which('go')
|
||||
if not go:
|
||||
raise SystemExit('The go tool was not found on this system. Install Go')
|
||||
cmd = [go, 'build']
|
||||
if args.verbose:
|
||||
cmd.append('-v')
|
||||
if not args.debug:
|
||||
cmd += ['-ldflags', '-s -w']
|
||||
cmd += ['-o', os.path.join(launcher_dir, 'kitty-tool'), os.path.abspath('tools/cmd')]
|
||||
print(shlex.join(cmd))
|
||||
cp = subprocess.run(cmd)
|
||||
if cp.returncode != 0:
|
||||
raise SystemExit(cp.returncode)
|
||||
|
||||
Reference in New Issue
Block a user