Align our subprocess usage with current best practices. (#12940)
* Align our subprocess usage with current best practices. * remove unused import * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> * fix the cpp invocation for older python * allow for unprompted installation * make sure qmk new-keyboard works on windows Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
parent
a9aec546c8
commit
db1eacdaac
22 changed files with 70 additions and 78 deletions
|
@ -1,8 +1,8 @@
|
|||
"""Build QMK documentation locally
|
||||
"""
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from subprocess import DEVNULL
|
||||
|
||||
from milc import cli
|
||||
|
||||
|
@ -24,14 +24,16 @@ def generate_docs(cli):
|
|||
shutil.copytree(DOCS_PATH, BUILD_PATH)
|
||||
|
||||
# When not verbose we want to hide all output
|
||||
args = {'check': True}
|
||||
if not cli.args.verbose:
|
||||
args.update({'stdout': subprocess.DEVNULL, 'stderr': subprocess.STDOUT})
|
||||
args = {
|
||||
'capture_output': False if cli.config.general.verbose else True,
|
||||
'check': True,
|
||||
'stdin': DEVNULL,
|
||||
}
|
||||
|
||||
cli.log.info('Generating internal docs...')
|
||||
|
||||
# Generate internal docs
|
||||
subprocess.run(['doxygen', 'Doxyfile'], **args)
|
||||
subprocess.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args)
|
||||
cli.run(['doxygen', 'Doxyfile'], **args)
|
||||
cli.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args)
|
||||
|
||||
cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue