Files
minisrv/zefie_wtvp_minisrv/test.js
zefie e591d255b7 v0.9.6
- update: app.js: add really long timeout for closing missed sockets
 - update: app.js: fix for minibrowser connectivity
 - update: app.js: enhance security
 - update: wtv-home:/home: fix wtv-needs-upgrade -> wtv-need-upgrade
 - update: wtv-head-waiter:/login-stage-two: do not send wtv-settings:/get to minibrowser
 - update: wtv-1800:/preregister: Disconnect and clean up all previous sockets for the connecting SSID when hitting preregister. Also re-create wtvsec_login.
 - update: add initial wtv-capability-flags decoding, as well as wtv-tricks:/info demonstration
 - update: rename classes
 - minor update: quirky 'Special Thanks' in each custom class.
 - minor update: notice about Initial Shared Key and multiple minisrvs
 - update: wtv-music:/demo/index: update wtv-star image paths
 - update: app.js: fix unencrypted post
 - update: app.js: improve buffering and cleanup in attempt to fix occasional 'double-up' bug
 - update: info.js: remove debug dump of capabilities
 - Update: add test.js, syntax-testing script for `npm test`
 - Update: wtv-chat:/home experimental nick change page thanks to MattMan (chat still giving issues on real boxes, works in Viewer)
 - Update: README.md: Add ways to support the project
2022-11-29 07:43:52 -05:00

34 lines
989 B
JavaScript

const { promisify } = require('util');
const { resolve } = require('path');
const fs = require('fs');
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);
const { exec } = require("child_process");
var path = require('path');
async function getFiles(dir) {
const subdirs = await readdir(dir);
const files = await Promise.all(subdirs.map(async (subdir) => {
const res = resolve(dir, subdir);
return (await stat(res)).isDirectory() ? getFiles(res) : res;
}));
return files.reduce((a, f) => a.concat(f), []);
}
getFiles(__dirname)
.then(files => {
files.forEach(function (file) {
if (path.extname(file) == ".js" && file.indexOf("node_modules") == -1) {
console.log(" * Checking syntax of", file.replace(__dirname + path.sep, "." + path.sep));
exec("node --check \"" + file + "\"", (error, stdout, stderr) => {
if (stderr.length > 0) {
console.log(`${stderr}`);
return;
}
});
}
});
})
.catch(e => console.error(e));