mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Add basic error check in build_mod.js
Check if the additional file to add exists before trying to pack it. Note that there may be other ways reading the files could break, but this should suffice for most cases of getting it wrong.
This commit is contained in:
1 parent
b2408d54ec
commit
7bba6cbde6
1 file changed
+3
@@ -79,6 +79,9 @@ async function build(args) {
|
||||
|
||||
for (let pathParts of info.additional_files || []) {
|
||||
let filePath = path.join(args.sourceDir, ...pathParts);
|
||||
if (!await fs.pathExists(filePath)) {
|
||||
throw new Error(`Additional file ${filePath} does not exist`);
|
||||
}
|
||||
zip.file(path.posix.join(modName, path.basename(filePath)), fs.createReadStream(filePath));
|
||||
}
|
||||
delete info.additional_files;
|
||||
|
||||
Reference in new issue
Block a user