mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
Cube pack nits
This commit is contained in:
1 parent
f8ae26651e
commit
77b6bfbc6f
2 files changed
+7
-5
No files matched your search
@@ -8,7 +8,7 @@
|
|||||||
<license>License.txt</license>
|
<license>License.txt</license>
|
||||||
<supportContact>https://mongoose.ws/contact/</supportContact>
|
<supportContact>https://mongoose.ws/contact/</supportContact>
|
||||||
<releases>
|
<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-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-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>
|
<release date="2026-04-08" version="7.21.0">See https://github.com/cesanta/mongoose/releases/tag/7.21</release>
|
||||||
|
|||||||
+6
-4
@@ -11,6 +11,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
|
const zlib = require('zlib');
|
||||||
|
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
let outputFile = null;
|
let outputFile = null;
|
||||||
@@ -141,14 +142,15 @@ async function processHtml(content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cArray(data) {
|
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) {
|
function generateC(data) {
|
||||||
const destination = path.basename(inputFile);
|
const destination = `${path.basename(inputFile)}.gz`;
|
||||||
const stat = fs.statSync(inputFile);
|
const stat = fs.statSync(inputFile);
|
||||||
const mtime = parseInt(stat.mtimeMs / 1000);
|
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:
|
return `// DO NOT EDIT. This file is generated using this command:
|
||||||
// ${process.argv.join(' ')}
|
// ${process.argv.join(' ')}
|
||||||
@@ -158,7 +160,7 @@ function generateC(data) {
|
|||||||
static const unsigned char v0[] = {${bytes}};
|
static const unsigned char v0[] = {${bytes}};
|
||||||
|
|
||||||
const struct mg_mem_file mg_packed_files[] = {
|
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}
|
{NULL, NULL, 0, 0}
|
||||||
};
|
};
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in new issue
Block a user