tasklemon icon indicating copy to clipboard operation
tasklemon copied to clipboard

Watch feature

Open Darkle opened this issue 6 years ago • 1 comments

Hi, tasklemon looks neat. Any interest in adding a watch feature to watch files?

Darkle avatar Sep 27 '19 08:09 Darkle

Thanks 😄 Folder watching definitely sounds like it'd be a nice addition to Tasklemon, yes! It's a common scripting operation, and should fit in nicely with the other Folder APIs.

I'll first need to understand how it's most commonly used, though. What would you like to use it for?

Until it's added in Tasklemon proper, it's still doable using npm support. Here's what you could do with chokidar:

npm.chokidar.watch(pathToWatch, {
	awaitWriteFinish: true
}).on('add', filePath => {
	const changedFile = root.file(filePath);

	// do things
});

Cykelero avatar Sep 28 '19 09:09 Cykelero