From 568e1fee07725222b94f6d8fdb3b379ec39e5f9a Mon Sep 17 00:00:00 2001 From: neingeist Date: Fri, 13 Jun 2025 00:58:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20check=20that=20we're=20posting?= =?UTF-8?q?=20from=20the=20mediawiki=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 4_post_to_wiki.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/4_post_to_wiki.py b/4_post_to_wiki.py index e7bd30a..34fccba 100644 --- a/4_post_to_wiki.py +++ b/4_post_to_wiki.py @@ -28,6 +28,8 @@ def post(files): files.append(filepath) for filepath in files: + if OUTDIR_MEDIAWIKI not in filepath: + raise ValueError("{filepath} not in {OUTDIR_MEDIAWIKI}") filename = os.path.basename(filepath) article_name = WIKI_ARTICLE_PREFIX + filename.replace(".mediawiki", "")