From 009d4cf75f3760152b8424e57f2f9854bb3111dc Mon Sep 17 00:00:00 2001 From: TheAfroOfDoom Date: Sat, 20 Jan 2024 18:27:43 -0500 Subject: [PATCH] fix watch script crashing when ajmodel has too many export files - just add `awaitWriteFinish` to datapack watcher - maybe to resourcepack watcher too? exporting the whole suite of ajmodels works for now though so nbd --- package-scripts/watch.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package-scripts/watch.js b/package-scripts/watch.js index 86e907dad..1b4fa1cd3 100644 --- a/package-scripts/watch.js +++ b/package-scripts/watch.js @@ -60,7 +60,15 @@ const watchDatapacks = async (showVerbose) => { await remove(`${worldPath}/datapacks`); await copy('datapacks', `${worldPath}/datapacks`, { filter: copyFilter }); - const watcher = watch('datapacks', { ignored, ignoreInitial: true }); + const awaitWriteFinish = { + stabilityThreshold: 200, + pollInterval: 100, + }; + const watcher = watch('datapacks', { + awaitWriteFinish, + ignored, + ignoreInitial: true, + }); watcher.on('ready', async () => { log('initialized');