From 3dde3b9237ff1d81fea42ce3ecd89d7d8165f708 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 17 Feb 2023 23:16:02 -0600 Subject: [PATCH] fix(build): add make target for watch mode --- gui/Makefile | 3 +++ gui/esbuild.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gui/Makefile b/gui/Makefile index 053c7534..676cabd5 100644 --- a/gui/Makefile +++ b/gui/Makefile @@ -55,3 +55,6 @@ lint: deps test: build MOCHA_FILE=out/test-results.xml yarn c8 $(COVER_OPTS) mocha $(MOCHA_OPTS) "out/**/Test*.js" + +watch: deps + WATCH=TRUE make ci diff --git a/gui/esbuild.js b/gui/esbuild.js index d81e507a..26acf873 100644 --- a/gui/esbuild.js +++ b/gui/esbuild.js @@ -3,8 +3,14 @@ import { join } from 'path'; import alias from 'esbuild-plugin-alias'; import { copy } from 'esbuild-plugin-copy'; -const debug = process.env['DEBUG'] === 'TRUE'; -const watch = process.env['WATCH'] === 'TRUE'; +function envTrue(key) { + const val = (process.env[key] || '').toLowerCase(); + return val == '1' || val == 't' || val == 'true' || val == 'y' || val == 'yes'; + +} + +const debug = envTrue('DEBUG'); +const watch = envTrue('WATCH'); const root = process.cwd(); const plugins = [];