Files
Paradise/tgui/packages/tgui-dev-server/util.js
T
AffectedArc07 58aa86cb9f TGUI-V3 (#13310)
* I need that gitignore file

* Temp Commit - DOES NOT COMPILE

* THE SHIT WORKS

* Readme change

* Disposal Unit --> TGUI

* mmmm yes CI which may not actually work

* New GitIgnore

* ITS TGUI-NEXT BABY

* Doc update

* CI tweak

* Chmod

* And again

* *sigh*

* Lets appreciate the irony of me failing CI stages

* 0/1 --> True/False

* Fixes some update nonsense

* CI Update

* Lets try this

* What about this maybe

* NVM is hurting me

* I swear to god

* A little bit of validation in my life

* V3 BABYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

* Fixes

* Fixes NaN appearing for a few frames when UIs open

* Fixes + Crew Monitor

* Corn + Steel + Mochi Fixes

* Forgot this

* Fixes from stylemistake

* Code Change

* Adds logout proc

* Offline implications + Resizeable crew monitor

* Change locate() to locateUID()

* Change div --> box
2020-06-30 03:51:36 -04:00

27 lines
564 B
JavaScript

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;
};