mite-cli
Version:
command line tool for time tracking service mite.de
25 lines (21 loc) • 640 B
JavaScript
const program = require('commander');
const pkg = require("./../package.json");
const config = require('./config');
const Cache = require("./lib/cache");
const { handleError } = require("./lib/errors");
program
.version(pkg.version)
.description("Clear the cache erasing all the saved mite data.");
function main() {
const cachePath = config.stores.defaults.store.cacheFilename;
const cache = new Cache(cachePath);
process.stdout.write('Clearing cache...\n');
return cache.clear().save().then(() => {
process.stdout.write("Cleared.\n");
});
}
try {
program.action(main).parse();
} catch (err) {
handleError(err);
}