@atomist/automation-client
Version:
Atomist API for software low-level client
20 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const fileGlobs_1 = require("../fileGlobs");
const projectUtils_1 = require("./projectUtils");
const Separator = "-------------------";
/**
* Use as a diagnostic step in an editor chain.
* No op that dumps file information to the console.
* @param stepName identification of the step in the process we're up to
* @param globPattern optional glob pattern to select files. Match all if not supplied
* @param stringifier function to convert files to strings. Default uses path
*/
function diagnosticDump(stepName, globPattern = fileGlobs_1.AllFiles, stringifier = f => f.path) {
return project => projectUtils_1.saveFromFiles(project, globPattern, f => f)
.then(files => console.log(`${Separator}\nProject name ${project.name}: Step=${stepName}; Files[${globPattern}]=\n` +
`${files.map(f => "\t" + stringifier(f)).join("\n")}\n${Separator}`))
.then(() => project);
}
exports.diagnosticDump = diagnosticDump;
//# sourceMappingURL=diagnosticUtils.js.map