{"size": 663, "ext": "js", "max_stars_repo_path": "eon-cli/src/bin/clear.js", "max_stars_repo_name": "vimlet/eon", "max_stars_repo_stars_event_min_datetime": "2019-02-06T14:13:27.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-02T22:49:36.000Z", "max_issues_repo_path": "eon-cli/src/bin/clear.js", "max_issues_repo_name": "vimlet/eon", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "eon-cli/src/bin/clear.js", "max_forks_repo_name": "vimlet/eon", "max_forks_repo_forks_event_min_datetime": "2019-04-14T21:45:58.000Z", "max_forks_repo_forks_event_max_datetime": "2020-05-18T08:07:30.000Z"}
{"max_stars_count": 23, "max_issues_count": null, "max_forks_count": 8, "avg_line_length": 24.5555555556, "max_line_length": 103, "alphanum_fraction": 0.5671191554}
var commons = require("@vimlet/commons");
var fs = require("fs-extra");
var url = require("url");
var btoa = require("btoa");

var path = require("path");
var os = require("os");
var rimraf = require("rimraf");

module.exports = function (result) {

    var clearArguments = {
        cache: true
    };

    if (clearArguments[result.clear]) {
        // Remove .eon 
        if (result.clear.toLowerCase() === "cache") {
            var deletePath = path.join(os.homedir(), ".eon");
    
            rimraf.sync(deletePath);
        }
    } else {
        console.log("\nInvalid \"clear\" argument [" + Object.keys(clearArguments).toString() + "]\n");
    }

};