Protect against standing in the wrong folder when running makemessages or compilemessages i18n commands. Resolve #2582
This commit is contained in:
parent
a17fa2a454
commit
a19211f3fd
1 changed files with 5 additions and 0 deletions
|
|
@ -2316,6 +2316,11 @@ def main():
|
||||||
if option in ("makemessages", "compilemessages"):
|
if option in ("makemessages", "compilemessages"):
|
||||||
# some commands don't require the presence of a game directory to work
|
# some commands don't require the presence of a game directory to work
|
||||||
need_gamedir = False
|
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"):
|
if option in ("shell", "check", "makemigrations", "createsuperuser", "shell_plus"):
|
||||||
# some django commands requires the database to exist,
|
# some django commands requires the database to exist,
|
||||||
# or evennia._init to have run before they work right.
|
# or evennia._init to have run before they work right.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue