UNPKG

@plugjs/plug

Version:
26 lines (24 loc) 734 B
"use strict"; // plugs/rmf.ts var import_fs = require("../fs.cjs"); var import_logging = require("../logging.cjs"); var import_pipe = require("../pipe.cjs"); (0, import_pipe.install)("rmf", class Rmf { _dryRun; constructor(dryRun) { this._dryRun = !!dryRun; } async pipe(files, context) { if (this._dryRun) { for (const file of files.absolutePaths()) { context.log.notice("Not removing file", (0, import_logging.$p)(file), (0, import_logging.$gry)("(dry-run)")); } } else { for (const file of files.absolutePaths()) { context.log.notice("Removing file", (0, import_logging.$p)(file)); await (0, import_fs.rm)(file); } } } }); //# sourceMappingURL=rmf.cjs.map