Cube pack nits

This commit is contained in:
cpq
2026-05-11 09:23:41 +01:00
parent f8ae26651e
commit 77b6bfbc6f
2 changed files with 7 additions and 5 deletions
@@ -8,7 +8,7 @@
<license>License.txt</license>
<supportContact>https://mongoose.ws/contact/</supportContact>
<releases>
<release date="2026-05-09" version="7.21.6">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2026-05-11" version="7.21.6">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2026-05-05" version="7.21.5">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2026-04-24" version="7.21.4">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
<release date="2026-04-08" version="7.21.0">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
+6 -4
View File
@@ -11,6 +11,7 @@ const fs = require('fs');
const path = require('path');
const http = require('http');
const https = require('https');
const zlib = require('zlib');
const args = process.argv.slice(2);
let outputFile = null;
@@ -141,14 +142,15 @@ async function processHtml(content) {
}
function cArray(data) {
return Array.from(Buffer.from(data, 'utf8')).concat(0).join(',');
return Array.from(Buffer.from(data)).concat(0).join(',');
}
function generateC(data) {
const destination = path.basename(inputFile);
const destination = `${path.basename(inputFile)}.gz`;
const stat = fs.statSync(inputFile);
const mtime = parseInt(stat.mtimeMs / 1000);
const bytes = cArray(data);
const zipped = zlib.gzipSync(data);
const bytes = cArray(zipped);
return `// DO NOT EDIT. This file is generated using this command:
// ${process.argv.join(' ')}
@@ -158,7 +160,7 @@ function generateC(data) {
static const unsigned char v0[] = {${bytes}};
const struct mg_mem_file mg_packed_files[] = {
{"/${destination}", v0, sizeof(v0) - 1, ${mtime}},
{"/${destination}", v0, sizeof(v0) - 1, ${mtime}}, // size: ${zipped.length}
{NULL, NULL, 0, 0}
};
`;