diff options
Diffstat (limited to 'servo')
-rw-r--r-- | servo/management/commands/selfupdate.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/servo/management/commands/selfupdate.py b/servo/management/commands/selfupdate.py new file mode 100644 index 0000000..d985041 --- /dev/null +++ b/servo/management/commands/selfupdate.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- + +import os.path +from subprocess import call +from django.conf import settings +from django.core.management.base import BaseCommand + + +class Command(BaseCommand): + + help = "Updates this Servo installation" + + def handle(self, *args, **options): + mc = os.path.join(settings.BASE_DIR, 'manage.py') + call(['git', 'pull', 'origin', 'master']) + call([mc, 'migrate', '--no-initial-data']) + call([mc, 'clearsessions']) |