mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 21:25:04 -07:00
chore(gen_vimdoc): call delete_lines_below
only if the file exists
Previously, `delete_lines_below` would raise `FileNotFoundError` when adding a new file to `CONFIG` and you had to manually write a file with help tag of the first section as placeholder. This change relieves you of that need.
This commit is contained in:
parent
2d28c40ef9
commit
cf4786ddfa
@ -1116,6 +1116,7 @@ def main(config, args):
|
|||||||
doc_file = os.path.join(base_dir, 'runtime', 'doc',
|
doc_file = os.path.join(base_dir, 'runtime', 'doc',
|
||||||
CONFIG[target]['filename'])
|
CONFIG[target]['filename'])
|
||||||
|
|
||||||
|
if os.path.exists(doc_file):
|
||||||
delete_lines_below(doc_file, first_section_tag)
|
delete_lines_below(doc_file, first_section_tag)
|
||||||
with open(doc_file, 'ab') as fp:
|
with open(doc_file, 'ab') as fp:
|
||||||
fp.write(docs.encode('utf8'))
|
fp.write(docs.encode('utf8'))
|
||||||
|
Loading…
Reference in New Issue
Block a user