Protect against standing in the wrong folder when running makemessages or compilemessages i18n commands. Resolve #2582

This commit is contained in:
Griatch 2022-02-12 18:59:00 +01:00
parent a17fa2a454
commit a19211f3fd

View file

@ -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.