mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 04:31:05 +00:00
Make file resolving non-blocking for local paths
This commit is contained in:
parent
897cbfec77
commit
78e0d88f55
2 changed files with 7 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -195,7 +195,12 @@ class ClientDataResolver {
|
||||||
return reject(new Error(`The file could not be found: ${file}`));
|
return reject(new Error(`The file could not be found: ${file}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolve(fs.readFileSync(file));
|
fs.readFile(file, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve(data);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue