Make docs command args always a list

This commit is contained in:
fauxpark 2024-11-20 16:53:11 +11:00
parent 2092b0a993
commit 79d9660812
2 changed files with 5 additions and 5 deletions

View File

@ -27,8 +27,8 @@ def generate_docs(cli):
return False return False
cli.log.info('Building vitepress docs') cli.log.info('Building vitepress docs')
run_docs_command('run', 'docs:build') run_docs_command('run', ['docs:build'])
cli.log.info('Successfully generated docs to %s.', BUILD_DOCS_PATH) cli.log.info('Successfully generated docs to %s.', BUILD_DOCS_PATH)
if cli.args.serve: if cli.args.serve:
run_docs_command('run', 'docs:preview') run_docs_command('run', ['docs:preview'])

View File

@ -17,7 +17,7 @@ BUILD_DOCS_PATH = BUILD_PATH / 'docs'
DOXYGEN_PATH = BUILD_DOCS_PATH / 'static' / 'doxygen' DOXYGEN_PATH = BUILD_DOCS_PATH / 'static' / 'doxygen'
def run_docs_command(verb, cmd=None): def run_docs_command(verb, cmd_args=None):
environ['PATH'] += pathsep + str(NODE_MODULES_PATH / '.bin') environ['PATH'] += pathsep + str(NODE_MODULES_PATH / '.bin')
args = {'capture_output': False, 'check': True} args = {'capture_output': False, 'check': True}
@ -27,8 +27,8 @@ def run_docs_command(verb, cmd=None):
args['env'] = docs_env args['env'] = docs_env
arg_list = ['yarn', verb] arg_list = ['yarn', verb]
if cmd: if cmd_args:
arg_list += cmd arg_list.extend(cmd_args)
chdir(BUILDDEFS_PATH) chdir(BUILDDEFS_PATH)
cli.run(arg_list, **args) cli.run(arg_list, **args)