Ignore relative requires
This commit is contained in:
parent
cff2aa29e7
commit
a47c0a0e95
|
@ -22,6 +22,12 @@ originalFs.writeFile = (path, data, options) => fs.writeFile(path, data, Object.
|
||||||
|
|
||||||
export const createRequire = function (path) {
|
export const createRequire = function (path) {
|
||||||
return mod => {
|
return mod => {
|
||||||
|
// Ignore relative require attempts because Discord
|
||||||
|
// erroneously does this a lot apparently which
|
||||||
|
// causes us to do filesystem accesses in our default
|
||||||
|
// switch statement mainly used for absolute paths
|
||||||
|
if (typeof(mod) === "string" && mod.startsWith("./")) return;
|
||||||
|
|
||||||
if (deprecated.has(mod)) {
|
if (deprecated.has(mod)) {
|
||||||
Logger.warn("Remote~Require", `The "${mod}" module is marked as deprecated. ${deprecated.get(mod)}`);
|
Logger.warn("Remote~Require", `The "${mod}" module is marked as deprecated. ${deprecated.get(mod)}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue