Open Richienb opened 4 months ago
Maybe we can call the functions temporaryDirectoryContext
and temporaryDirectoryTaskContext
?
temporaryDirectoryTaskContext
Couldn't this just be temporaryDirectoryContext().task
?
Couldn't this just be
temporaryDirectoryContext().task
?
We could, but I don't think this is a good idea. Methods in the returned object are for things happening within the temporary directory, not the temporary directory itself.
On second thought, temporaryDirectoryContext().task
might be a good idea if we suppose that we want to clear/delete the same directory after different parts of the run. This would be adding new functionality only accessible by context.
I wonder how essential/nice it would be to re-use the same temporary directory rather than creating a new one for each task.
Idea: We could use a higher-level approach to discourage bad behaviour.
Something like:
Perhaps we could call them
temporaryDirectoryContext
andtemporaryDirectoryContextTask
? Perhaps we only need the latter?Context: https://github.com/sindresorhus/tempy/issues/35#issuecomment-2093947983