Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-12 19:51:32 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-12 19:52:32 (GMT)
commit72f029997ecc4d5fed479120d77d844b95732ad2 (patch)
tree601e23ec9cb87d84bd21e612a169fa5e8d32199e
parent7e9aee8e38e1680057ac4409774f1de67cc6efa2 (diff)
Save state every time we complete a module
-rwxr-xr-xscripts/dn-build19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/dn-build b/scripts/dn-build
index df9c414..14daf33 100755
--- a/scripts/dn-build
+++ b/scripts/dn-build
@@ -37,6 +37,15 @@ module_files = { "activities": ["activities.json"],
state = { "built_modules": {} }
+def load_state():
+ global state
+
+ if os.path.exists(build_state_path):
+ state = json.load(open(build_state_path))
+
+def save_state():
+ json.dump(state, open(build_state_path, "w+"))
+
def add_path(name, path):
if name not in os.environ:
os.environ[name] = path
@@ -131,6 +140,7 @@ def build(module):
sys.exit(1)
state["built_modules"][module["name"]] = get_module_commit_id(module)
+ save_state()
def cmd_build():
modules = []
@@ -226,15 +236,6 @@ def setup_dirs():
if not os.path.exists(dir):
os.mkdir(dir)
-def load_state():
- global state
-
- if os.path.exists(build_state_path):
- state = json.load(open(build_state_path))
-
-def save_state():
- json.dump(state, open(build_state_path, "w+"))
-
def main():
load_state()