markdown_link_checker_sc 0.0.141 → 0.0.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
- package/src/process_image_orphans.js +7 -4
package/index.js
CHANGED
|
@@ -35,8 +35,8 @@ program
|
|
|
35
35
|
)
|
|
36
36
|
.option(
|
|
37
37
|
"-d, --doc [directory]",
|
|
38
|
-
"Docs root directory, relative to -r (such as `docs`). Defaults to '' (all docs in root of repo).
|
|
39
|
-
|
|
38
|
+
"Docs root directory, relative to -r (such as `docs`). Defaults to '' (all docs in root of repo).",
|
|
39
|
+
""
|
|
40
40
|
)
|
|
41
41
|
.option(
|
|
42
42
|
"-e, --subdir [directory]",
|
package/package.json
CHANGED
|
@@ -15,10 +15,13 @@ var otherFileTypes = []; // Just used for logging in function below.
|
|
|
15
15
|
async function getAllImageFilesInDirectory(dir, options) {
|
|
16
16
|
logFunction(options, `Function: getAllImageFilesInDirectory(${dir})`);
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
let files;
|
|
19
|
+
try {
|
|
20
|
+
files = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
21
|
+
} catch {
|
|
22
|
+
console.warn(`Warning: Image directory not found, skipping orphan check: ${dir}`);
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
22
25
|
const images = [];
|
|
23
26
|
for (let i = 0; i < files.length; i++) {
|
|
24
27
|
const file = path.join(dir, files[i].name);
|