From a19211f3fd677316a9d52ea579bb4b57113831a3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 12 Feb 2022 18:59:00 +0100 Subject: [PATCH] Protect against standing in the wrong folder when running makemessages or compilemessages i18n commands. Resolve #2582 --- evennia/server/evennia_launcher.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py index e1b8e69af3..846e674ad0 100644 --- a/evennia/server/evennia_launcher.py +++ b/evennia/server/evennia_launcher.py @@ -2316,6 +2316,11 @@ def main(): if option in ("makemessages", "compilemessages"): # some commands don't require the presence of a game directory to work need_gamedir = False + if CURRENT_DIR != EVENNIA_LIB: + print("You must stand in the evennia/evennia/ folder (where the 'locale/' " + "folder is located) to run this command.") + sys.exit() + if option in ("shell", "check", "makemigrations", "createsuperuser", "shell_plus"): # some django commands requires the database to exist, # or evennia._init to have run before they work right.