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:
Alexander Hedges
2015-11-07 18:25:16 +01:00
committed by ridiculousfish
parent 22493c9df8
commit 2bbad22248

View File

@@ -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)