diff --git a/pyproject.toml b/pyproject.toml index c0d91650..773f40f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ docs-check = [ {script = "tasks:output_file('sitemap.xml')"}, {script = "tasks:generate_pa11y_config_from_sitemap"}, {script = "tasks:output_file('config.json')"}, - {cmd = "npx pa11y-ci -c config.json"}, + {script = "tasks:run_shell('npx pa11y-ci -c config.json')"}, {script = "tasks:delete_files(['sitemap.xml', 'config.json'])"}, ] docs-run = [ diff --git a/tasks.py b/tasks.py index 453c2334..0fd966bd 100644 --- a/tasks.py +++ b/tasks.py @@ -4,6 +4,7 @@ import json import os import pathlib +import subprocess import requests import xmltodict @@ -18,6 +19,11 @@ def delete_files(files): pathlib.Path(file).unlink(missing_ok=True) +def run_shell(command): + # Required to run NPM commands in Windows and *nix + subprocess.call(command, shell=True) + + def generate_sitemap(): sitemap = requests.get(f"{DOCS_URL}/{SITEMAP_FILENAME}") with open(SITEMAP_FILENAME, "wb") as f: