|
|
@ -8,6 +8,8 @@ from subprocess import call |
|
|
|
import click |
|
|
|
from platformio import util |
|
|
|
|
|
|
|
import distutils.spawn |
|
|
|
|
|
|
|
Import("env") |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
|
|
@ -81,10 +83,13 @@ def check_size(source, target, env): |
|
|
|
print_filler("*", color=Color.LIGHT_YELLOW, err=True) |
|
|
|
|
|
|
|
def build_webui(env): |
|
|
|
config = util.load_project_config() |
|
|
|
kv = dict(config.items("env:" + env.get('PIOENV'))) |
|
|
|
modules = kv["modules"] if "modules" in kv else "all" |
|
|
|
env.Execute("WEBUI_MODULES=\"%s\" node node_modules/gulp/bin/gulp.js" % modules) |
|
|
|
if distutils.spawn.find_executable("node"): |
|
|
|
config = util.load_project_config() |
|
|
|
kv = dict(config.items("env:" + env.get('PIOENV'))) |
|
|
|
modules = kv["modules"] if "modules" in kv else "all" |
|
|
|
env.Execute("WEBUI_MODULES=\"%s\" node node_modules/gulp/bin/gulp.js" % modules) |
|
|
|
else: |
|
|
|
print_warning("Not building the web UI image ('node' does not exist in the path)") |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
|
|
|
# Hooks |
|
|
|