mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Docs: Make docsite rebuilds smarter/faster (#45062)
* Make the following scripts idempotent so that we only have to rebuild changed docs, not all docs: * plugin_formatter * generate_man * dump_keywords.py * dump_config.py * testing_formatter.sh
This commit is contained in:
parent
6e68d77f6d
commit
310b0a2521
8 changed files with 61 additions and 32 deletions
|
@ -56,6 +56,7 @@ from ansible.module_utils.parsing.convert_bool import boolean
|
|||
from ansible.plugins.loader import fragment_loader
|
||||
from ansible.utils import plugin_docs
|
||||
from ansible.utils.display import Display
|
||||
from ansible.utils._build_helpers import update_file_if_different
|
||||
|
||||
|
||||
#####################################################################################
|
||||
|
@ -183,8 +184,8 @@ def write_data(text, output_dir, outputname, module=None):
|
|||
os.makedirs(output_dir)
|
||||
fname = os.path.join(output_dir, outputname)
|
||||
fname = fname.replace(".py", "")
|
||||
with open(fname, 'wb') as f:
|
||||
f.write(to_bytes(text))
|
||||
|
||||
update_file_if_different(fname, to_bytes(text))
|
||||
else:
|
||||
print(text)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue