psclear
Version:
It cleans up the unnecessary .ps1 files that are created when you use an incorrect npm cli command.
14 lines (9 loc) • 409 B
JavaScript
var shell = require("shelljs");
const { program } = require('commander');
program.command("psclear").action((str, opt) => {
var a = shell.exec('whoami && cls');
var computerName = a.stdout.split("\\")[1].trim();
shell.exec(`cd C:\\Users\\${computerName}\\AppData\\Roaming\\npm && del *.ps1`);
shell.exec("color a && echo .ps1 files cleaned successfully");
})
program.parse();