Unable to run custom ng update schematic. The goal is to traverse html files and search for certain dom attributes, however I am unsure how to properly traverse the Tree structure in an angular application. I have not found a great deal online regarding this and am hoping for some results here. Below is my Rule factory for how I am currently trying to access the file system.
export default function MigrationUpdate(_options: any): Rule {
return (host: Tree, _context: SchematicContext) => {
//Traverse file system in angular application
//Searching for html files
host.getDir('/files').visit(filePath => {
if (!filePath.endsWith('.html')) {
return;
}
const text = host.read(filePath);
if (text === null) {
throw new SchematicsException('Unable to read file path.');
}
});
return host;
};
}