duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

Implement duo cache clean #437

Closed darsain closed 9 years ago

darsain commented 9 years ago

Duo caches resolved tags in os.tmpdir() . '/duo', but doesn't provide an API to clean that when necessary.

Did some tagging shenanigans today and couldn't figure out why duo was resolving version to an old commit, as there was no mention of any caching happening in docs, nor any cleaning command to suggest something like that is in duo, so I've spend quite some time looking in another direction while debugging the issue. Damn it :)

stephenmathieson commented 9 years ago

thoughts on a duo-clear-cache command?

could be something as simple as:

#!/usr/bin/env node
var rm = require('rimraf').sync
var os = require('os')
var path = require('path')

var cache = path.join(os.tmpdir(), 'duo')

rm(cache)
matthewmueller commented 9 years ago

i'm +1, given that the caching issues still haven't been resolved.

stephenmathieson commented 9 years ago

cool, i'll put something together soonish

dominicbarnes commented 9 years ago

In case it wasn't obvious, this script should also destroy components/duo.json.

Also, should we follow node's convention and use duo cache clean ?