mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 03:22:41 +00:00
* MIT license headers * various tweaks - Tweak jsdoc headers a bit - Use an old-school format with SPDX-License-Identifier for SCSS - Add headers to tgui dmcode * Simplify the license section * Rebuild tgui, small tweaks Co-authored-by: ZeWaka <zewakagamer@gmail.com> About The Pull Request All relevant source code now contains copyright headers, that explicitly assert copyright and license for every file. This has been done to prepare TGUI for wider adoption. Goon station devs are interested in using TGUI, and hopefully this will result in a nice collaboration and improvements to both codebases. The following files were relicensed under MIT: code/controllers/subsystem/tgui.dm code/modules/tgui/*.dm tgui/**/*.js tgui/**/*.scss The following files were kept untouched: tgui/packages/tgui/interfaces/**/*.js tgui/packages/tgui/styles/interfaces/**/*.scss Project is still basically AGPL-3.0 under /tg/station's parent license (with added MIT texts), but allows importing MIT code into MIT-compatible codebases.
33 lines
633 B
JavaScript
33 lines
633 B
JavaScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
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;
|
|
};
|