mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:11:15 -03:00
Remove autogenerated files before generating the new ones
Currently if there is a conflict with two manpages having the same name, one completion will override the other. But if one can be parsed and the other can't the one with parsed results will always have a higher priority.
This commit is contained in:
committed by
ridiculousfish
parent
22493c9df8
commit
2bbad22248
@@ -817,15 +817,7 @@ def parse_manpage_at_path(manpage_path, output_directory):
|
||||
parser_names = ', '.join(p.name() for p in parsersToTry)
|
||||
#add_diagnostic('%s contains no options or is unparsable' % manpage_path, BRIEF_VERBOSE)
|
||||
add_diagnostic('%s contains no options or is unparsable (tried parser %s)' % (manpage_path, parser_names), BRIEF_VERBOSE)
|
||||
# Make sure we delete any old completion
|
||||
if not WRITE_TO_STDOUT:
|
||||
fullpath = os.path.join(output_directory, CMDNAME + '.fish')
|
||||
try:
|
||||
os.remove(fullpath)
|
||||
except (OSError, IOError):
|
||||
# Ignore failure
|
||||
pass
|
||||
|
||||
|
||||
return success
|
||||
|
||||
def parse_and_output_man_pages(paths, output_directory, show_progress):
|
||||
@@ -983,4 +975,8 @@ if __name__ == "__main__":
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
if not WRITE_TO_STDOUT:
|
||||
# Remove old generated files
|
||||
cleanup_autogenerated_completions_in_directory(output_directory)
|
||||
|
||||
parse_and_output_man_pages(file_paths, output_directory, show_progress)
|
||||
|
||||
Reference in New Issue
Block a user