From 660512e38fc44ee8cac7377cf701502038a969a4 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 17 May 2014 16:31:05 +0200 Subject: [PATCH] ./ctl setup --- ctl | 1 - oml/commands.py | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ctl b/ctl index c0ccd8e..0705e81 100755 --- a/ctl +++ b/ctl @@ -83,7 +83,6 @@ if [ "$1" == "update" ]; then git pull cd $BASE/$NAME git pull - $0 db upgrade $0 setup $0 update_static > /dev/null exit diff --git a/oml/commands.py b/oml/commands.py index d496cff..fcd94a8 100644 --- a/oml/commands.py +++ b/oml/commands.py @@ -2,14 +2,22 @@ # vi:si:et:sw=4:sts=4:ts=4 from __future__ import division +import subprocess +import os + from flask.ext.script import Command +def r(*cmd): + print ' '.join(cmd) + return subprocess.call(cmd) + class Setup(Command): """ setup new node """ def run(self): + r('./ctl', 'db', 'upgrade') import setup import settings setup.create_default_lists() @@ -21,14 +29,8 @@ class UpdateStatic(Command): setup new node """ def run(self): - import subprocess - import os import settings - def r(*cmd): - print ' '.join(cmd) - return subprocess.call(cmd) - oxjs = os.path.join(settings.static_path, 'oxjs') if not os.path.exists(oxjs): r('git', 'clone', 'https://git.0x2620.org/oxjs.git', oxjs)