Skip to content

Commit 97ea4b3

Browse files
committed
docs(material/form-field): add guide for creating reusable Material components
1 parent d02338b commit 97ea4b3

File tree

5 files changed

+768
-1
lines changed

5 files changed

+768
-1
lines changed

docs/tools/lighthouse-audit.mjs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,25 @@ async function cleanupAndPrepareReportsDir() {
169169
await fs.promises.rm(reportsDir, {recursive: true});
170170
} catch {}
171171

172-
await fs.promises.mkdir(reportsDir, {recursive: true});
172+
try {
173+
await fs.promises.mkdir(reportsDir, {recursive: true});
174+
} catch (err) {
175+
// If mkdir fails, try to create the entire path structure
176+
const pathParts = reportsDir.split(path.sep);
177+
let currentPath = pathParts[0] || path.sep;
178+
179+
for (let i = 1; i < pathParts.length; i++) {
180+
currentPath = path.join(currentPath, pathParts[i]);
181+
try {
182+
await fs.promises.mkdir(currentPath);
183+
} catch (mkdirErr) {
184+
// Ignore EEXIST errors, but throw others
185+
if (mkdirErr.code !== 'EEXIST') {
186+
throw mkdirErr;
187+
}
188+
}
189+
}
190+
}
173191
}
174192

175193
/**

0 commit comments

Comments
 (0)