🐛 check that we're posting from the mediawiki directory

This commit is contained in:
neingeist 2025-06-13 00:58:40 +02:00
parent 8519b97a1d
commit 568e1fee07

View file

@ -28,6 +28,8 @@ def post(files):
files.append(filepath) files.append(filepath)
for filepath in files: for filepath in files:
if OUTDIR_MEDIAWIKI not in filepath:
raise ValueError("{filepath} not in {OUTDIR_MEDIAWIKI}")
filename = os.path.basename(filepath) filename = os.path.basename(filepath)
article_name = WIKI_ARTICLE_PREFIX + filename.replace(".mediawiki", "") article_name = WIKI_ARTICLE_PREFIX + filename.replace(".mediawiki", "")