Skip to content

Commit

Permalink
fix watch script crashing when ajmodel has too many export files
Browse files Browse the repository at this point in the history
- just add `awaitWriteFinish` to datapack watcher
- maybe to resourcepack watcher too? exporting the whole suite of ajmodels works for now though so nbd
  • Loading branch information
TheAfroOfDoom committed Jan 20, 2024
1 parent 70addad commit 009d4cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion package-scripts/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 009d4cf

Please sign in to comment.