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({