aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
diff options
context:
space:
mode:
authorDaiki Mizukami <tesaguriguma@gmail.com>2022-03-13 21:13:42 +0900
committerDaiki Mizukami <tesaguriguma@gmail.com>2022-03-14 07:53:41 +0900
commitcf4786ddfae40a3a0d00e52f4861a2c7ee19e243 (patch)
treebf7fc14e2b46352b673973adf2605f7704485cd8 /scripts/gen_vimdoc.py
parent2d28c40ef9842ab7cfb9b307bfc07b1d11c7aca8 (diff)
downloadrneovim-cf4786ddfae40a3a0d00e52f4861a2c7ee19e243.tar.gz
rneovim-cf4786ddfae40a3a0d00e52f4861a2c7ee19e243.tar.bz2
rneovim-cf4786ddfae40a3a0d00e52f4861a2c7ee19e243.zip
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.
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-xscripts/gen_vimdoc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index 2b119bc589..a537f80aca 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -1116,7 +1116,8 @@ def main(config, args):
doc_file = os.path.join(base_dir, 'runtime', 'doc',
CONFIG[target]['filename'])
- delete_lines_below(doc_file, first_section_tag)
+ if os.path.exists(doc_file):
+ delete_lines_below(doc_file, first_section_tag)
with open(doc_file, 'ab') as fp:
fp.write(docs.encode('utf8'))