From c4e290a6132a8344a3d7069675d30e6c7d41c04f Mon Sep 17 00:00:00 2001 From: Indu Prakash Date: Sat, 15 Oct 2022 07:51:39 -0500 Subject: [PATCH] Update gulp to include space around = --- gulpfile.js | 26 +++++++++++--------------- src/httpserver/new_http.c | 11 +++++------ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1715d09c0..97c9c2bfc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,7 @@ function generateCode(field_name, is_script) { const prefix = is_script ? "" : ""; - output = `const char ${field_name}[]="${prefix}${output}${suffix}";`; + output = `const char ${field_name}[] = "${prefix}${output}${suffix}";`; const target_path = path.join(path.dirname(file.path), destination); //console.log(`Updated ${target_path}`); @@ -96,23 +96,19 @@ function generateCode(field_name, is_script) { } function minifyJs() { - return ( - gulp - .src("./src/httpserver/script.js") - .pipe(dumpFileSize()) - .pipe(uglify()) - .pipe(generateCode("pageScript", true)) - ); + return gulp + .src("./src/httpserver/script.js") + .pipe(dumpFileSize()) + .pipe(uglify()) + .pipe(generateCode("pageScript", true)); } function minifyHassDiscoveryJs() { - return ( - gulp - .src("./src/httpserver/script_ha_discovery.js") - .pipe(dumpFileSize()) - .pipe(uglify()) - .pipe(generateCode("ha_discovery_script", true)) - ); + return gulp + .src("./src/httpserver/script_ha_discovery.js") + .pipe(dumpFileSize()) + .pipe(uglify()) + .pipe(generateCode("ha_discovery_script", true)); } function minifyCss() { diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index e43ddcad5..c0e499632 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -598,13 +598,12 @@ int HTTP_ProcessPacket(http_request_t* request) { } /* -To edit the following two fields: -1. Edit the files script.js (pageScript) or script.css (htmlHeadStyle) -2. Generate compressed content using gulp or online compressor such as https://www.minifier.org/ +NOTE: -For using gulp, you need to have nodejs (https://nodejs.org/en/) installed. -After that run, `npm install` at the root folder to install dependent dev packages. -And then run `gulp` which will automatically update the fields. +The following fields should not be manually edited. +Instead, edit the script/css files in this folder and then re-generate the fields by running gulp. +Gulp tasks should automatically appear in Visual Code or can be invoked from console. +See https://github.com/openshwprojects/OpenBK7231T_App/blob/main/BUILDING.md for gulp setup. */ //region_start htmlHeadStyle