@decentralized-identity/ion-cli
Version:
A Command Line Interface (CLI) to make working with the ION network and using ION DIDs easy peasy lemon squeezy.
28 lines (27 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("@oclif/command");
const fs = require("fs-extra");
const path = require("path");
const { cli } = require('cli-ux');
class Clear extends command_1.Command {
async run() {
const { flags } = this.parse(Clear);
// Clear the cache
cli.action.start('Clearing cache.');
const cacheDirectory = path.join(flags.directory, 'cache');
await fs.emptyDir(cacheDirectory);
cli.action.stop();
this.exit();
}
}
exports.default = Clear;
Clear.description = 'Clears the DID cache, removing all previously resolved DIDs.';
Clear.examples = [
'$ ion cache:clear -d d:\dids',
];
Clear.flags = {
help: command_1.flags.help({ char: 'h' }),
// Flag for specifying a directory to which keys and documents should be saved.
directory: command_1.flags.string({ char: 'd', description: 'that contains the cache. Defaults to environment variable DID_PATH if set.', env: 'DID_PATH', required: true }),
};