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:
Dag Wieers 2018-09-12 22:50:36 +02:00 committed by Toshio Kuratomi
parent 6e68d77f6d
commit 310b0a2521
8 changed files with 61 additions and 32 deletions

View file

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