mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-20 14:45:05 +00:00
* Fixes tgui dev server [NO GBP] (#79898) ## About The Pull Request - the .js extensions were required, this is my fault. - fixes a crash "automatic publicPath is not supported in this browser" ## Why It's Good For The Game Bug fixes. Dev server is working ## Changelog N/A nothing player facing * Fixes tgui dev server [NO GBP] --------- Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
32 lines
601 B
JavaScript
32 lines
601 B
JavaScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import { require } from './require.js';
|
|
|
|
const globPkg = require('glob');
|
|
|
|
export const resolvePath = path.resolve;
|
|
|
|
/**
|
|
* Combines path.resolve with glob patterns.
|
|
*/
|
|
export const resolveGlob = (...sections) => {
|
|
const unsafePaths = globPkg.sync(path.resolve(...sections), {
|
|
strict: false,
|
|
silent: true,
|
|
});
|
|
const safePaths = [];
|
|
for (let path of unsafePaths) {
|
|
try {
|
|
fs.statSync(path);
|
|
safePaths.push(path);
|
|
} catch {}
|
|
}
|
|
return safePaths;
|
|
};
|