From 894e19124dce983b8b58e0490aabe076154c68ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 20 Jun 2018 10:14:04 +0200 Subject: [PATCH] Build correctly when no modules --- code/extra_scripts.py | 7 +++---- code/gulpfile.js | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/code/extra_scripts.py b/code/extra_scripts.py index 31baf56a..9d0bc80d 100644 --- a/code/extra_scripts.py +++ b/code/extra_scripts.py @@ -61,10 +61,9 @@ def check_size(source, target, env): def build_webui(source, target, env): config = util.load_project_config() - try: - os.environ['MODULES'] = config.get("env:" + env.get('PIOENV'), "modules") - except: - None + kv = dict(config.items("env:" + env.get('PIOENV'))) + if 'modules' in kv: + os.environ['MODULES'] = kv["modules"] call(["gulp"]) # ------------------------------------------------------------------------------ diff --git a/code/gulpfile.js b/code/gulpfile.js index 49dd69a4..ad270922 100644 --- a/code/gulpfile.js +++ b/code/gulpfile.js @@ -113,20 +113,20 @@ gulp.task('buildfs_inline', function() { light: false, rfbridge: false }; - var modules = process.env.MODULES || false; - if (modules) { + var modules = 'MODULES' in process.env ? process.env.MODULES : false; + if (false === modules) { + for (var i in remover_config) { + remover_config[i] = true; + } + } else { var list = modules.split(' '); for (var i in list) { if (list[i] != "") { remover_config[list[i]] = true; } } - } else { - for (var i in remover_config) { - remover_config[i] = true; - } } - log.info("[WEBUI] " + JSON.stringify(remover_config)); + log.info("Modules: " + JSON.stringify(remover_config)); return gulp.src('html/*.html'). pipe(htmllint({