mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 23:06:31 +01:00
Correct handling of migrations
This commit is contained in:
parent
a0b6c0fa1a
commit
471bced78b
1 changed files with 10 additions and 5 deletions
|
|
@ -2131,11 +2131,16 @@ def main():
|
|||
|
||||
init_game_directory(CURRENT_DIR, check_db=check_db, need_gamedir=need_gamedir)
|
||||
|
||||
# pass on to the core django manager - re-parse the entire input line
|
||||
# but keep 'evennia' as the name instead of django-admin. This is
|
||||
# an exit condition.
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(execute_from_command_line())
|
||||
if option == "migrate":
|
||||
# we have to launch migrate within the program to make sure migrations
|
||||
# run within the scope of the launcher (otherwise missing a db will cause errors)
|
||||
django.core.management.call_command(*([option] + unknown_args))
|
||||
else:
|
||||
# pass on to the core django manager - re-parse the entire input line
|
||||
# but keep 'evennia' as the name instead of django-admin. This is
|
||||
# an exit condition.
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(execute_from_command_line())
|
||||
|
||||
elif not args.tail_log:
|
||||
# no input; print evennia info (don't pring if we're tailing log)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue