Kills old TGUI, hardsyncs TGUI to 3.0

This commit is contained in:
Artur
2020-04-23 13:31:48 +03:00
parent 321902c35a
commit fe26034410
431 changed files with 2381 additions and 34240 deletions

View File

@@ -0,0 +1,26 @@
import glob from 'glob';
import { resolve as resolvePath } from 'path';
import fs from 'fs';
import { promisify } from 'util';
export { resolvePath };
/**
* Combines path.resolve with glob patterns.
*/
export const resolveGlob = async (...sections) => {
const unsafePaths = await promisify(glob)(
resolvePath(...sections), {
strict: false,
silent: true,
});
const safePaths = [];
for (let path of unsafePaths) {
try {
await promisify(fs.stat)(path);
safePaths.push(path);
}
catch {}
}
return safePaths;
};