- 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
34 lines
989 B
JavaScript
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));
|
|
|