cross-tools
Version:
Cross-platform fundamental tools for developers
1 lines • 652 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});const baseDockerAction_1=require("../baseDockerAction");class DockerAction extends baseDockerAction_1.BaseDockerAction{constructor(){super(...arguments),this.cmd="remove-images"}async handle(e){let o=0;await this.asyncLoader(async()=>{const t=await this.docker.listImages();if(e.untagged){const e=t.filter(e=>!e.RepoTags||"<none>:<none>"===e.RepoTags[0]);for(const t of e)await this.docker.getImage(t.Id).remove({force:{true:"true"}}),o++}},"Removing all untagged images");const t=this.colors.cyan(`✅ total ${o}: image(s) removed.`);console.log(t)}}exports.default=new DockerAction;