From aabae4e0fcee8a7bd2eaebcc863f42bd3a113bbc Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 13 Aug 2022 16:21:08 -0700 Subject: [PATCH] update commands to use python for win compat --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 540d0bab..e6aa9488 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ pytest = ">=6.2" pytest-bdd = ">=4.0.1,<6.0" pytest-clarity = "*" pytest-xdist = ">=2.5.0" +requests = "*" toml = ">=0.10" tox = "*" yq = "*" @@ -68,7 +69,13 @@ files = ["sitemap.xml", "list.json"] for f in files: pathlib.Path(f).unlink(missing_ok=True) """ -script-generate-sitemap.shell = 'curl -s "127.0.0.1:8000/sitemap.xml" > sitemap.xml' +script-generate-sitemap.interpreter = "python" +script-generate-sitemap.shell = ''' +import requests +sitemap = requests.get("http://127.0.0.1:8000/sitemap.xml") +with open('sitemap.xml', 'wb+') as f: + f.write(sitemap.content) +''' script-generate-page-list-from-sitemap.shell = ''' select='{urls: ["http://127.0.0.1:8000/", "http://127.0.0.1:8000/search.html?q=jrnl", .urlset.url[].loc]}' poetry run xq "$select" sitemap.xml > list.json