@objectivity/angular-schematic-utils
Version:
Utilities for working with Schematics.
17 lines • 628 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.overwriteIfExists = void 0;
const schematics_1 = require("@angular-devkit/schematics");
// Custom implementation of MergeStrategy.Override
// https://github.com/angular/angular-cli/issues/11337
function overwriteIfExists(host) {
return schematics_1.forEach(fileEntry => {
if (host.exists(fileEntry.path)) {
host.overwrite(fileEntry.path, fileEntry.content);
return null;
}
return fileEntry;
});
}
exports.overwriteIfExists = overwriteIfExists;
//# sourceMappingURL=merge-strategy.js.map