Open tunnckoCore opened 2 years ago
Use cacache.verify
after the loop, and cacache.rm.content
old content on changed
.
Also add done/finish
hook.
edit:
Seems like when you call verify it automatically cleans up the old content file and the index file. So, the only needed is to call it once at the end of all, such as in done
hook.
The done
hook is handy, if you don't want to include cacache
as dep in the upper module. Or because version collisions. This way you use the same cacache
version, as glob-cache
one.
Make the default done
hook do just that cacache.verify
.
Do not read the files by default.
Seems like currently, it detects that the file has changed, but doesn't update the cache to the new state. Thus, it always hits the
changed
hook.It's easy like
on the
if ctx.changed
, and after the call ofhooks.changed
.