DRYer
This commit is contained in:
parent
3206e1b12c
commit
ae43b1565e
7
setup.py
7
setup.py
@ -825,9 +825,10 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's
|
|||||||
def copy_man_pages(ddir: str) -> None:
|
def copy_man_pages(ddir: str) -> None:
|
||||||
mandir = os.path.join(ddir, 'share', 'man')
|
mandir = os.path.join(ddir, 'share', 'man')
|
||||||
safe_makedirs(mandir)
|
safe_makedirs(mandir)
|
||||||
|
man_levels = '15'
|
||||||
with suppress(FileNotFoundError):
|
with suppress(FileNotFoundError):
|
||||||
shutil.rmtree(os.path.join(mandir, 'man1'))
|
for x in man_levels:
|
||||||
shutil.rmtree(os.path.join(mandir, 'man5'))
|
shutil.rmtree(os.path.join(mandir, f'man{x}'))
|
||||||
src = 'docs/_build/man'
|
src = 'docs/_build/man'
|
||||||
if not os.path.exists(src):
|
if not os.path.exists(src):
|
||||||
raise SystemExit('''\
|
raise SystemExit('''\
|
||||||
@ -835,7 +836,7 @@ The kitty man pages are missing. If you are building from git then run:
|
|||||||
make && make docs
|
make && make docs
|
||||||
(needs the sphinx documentation system to be installed)
|
(needs the sphinx documentation system to be installed)
|
||||||
''')
|
''')
|
||||||
for x in '15':
|
for x in man_levels:
|
||||||
os.makedirs(os.path.join(mandir, f'man{x}'))
|
os.makedirs(os.path.join(mandir, f'man{x}'))
|
||||||
for y in glob.glob(os.path.join(src, f'*.{x}')):
|
for y in glob.glob(os.path.join(src, f'*.{x}')):
|
||||||
shutil.copy2(y, os.path.join(mandir, f'man{x}'))
|
shutil.copy2(y, os.path.join(mandir, f'man{x}'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user