termcap should be generated in generate not compile

This commit is contained in:
Kovid Goyal 2022-04-12 22:41:19 +05:30
parent aead3c1c35
commit 030e7e2db3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -27,13 +27,6 @@ def compile_terminfo(base):
os.makedirs(odir, exist_ok=True)
ofile = os.path.join(odir, xterm_kitty)
shutil.move(tfile, ofile)
proc = subprocess.run(['tic', '-CrT0', 'terminfo/kitty.terminfo'], capture_output=True)
if proc.returncode != 0:
sys.stderr.buffer.write(proc.stderr)
raise SystemExit(proc.returncode)
tcap = proc.stdout.decode('utf-8').splitlines()[-1]
with open('terminfo/kitty.termcap', 'w') as f:
f.write(tcap)
def generate_terminfo():
@ -45,6 +38,13 @@ def generate_terminfo():
with open('terminfo/kitty.terminfo', 'w') as f:
f.write(generate_terminfo())
proc = subprocess.run(['tic', '-CrT0', 'terminfo/kitty.terminfo'], capture_output=True)
if proc.returncode != 0:
sys.stderr.buffer.write(proc.stderr)
raise SystemExit(proc.returncode)
tcap = proc.stdout.decode('utf-8').splitlines()[-1]
with open('terminfo/kitty.termcap', 'w') as f:
f.write(tcap)
compile_terminfo(os.path.join(base, 'terminfo'))