diff options
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-x | scripts/documentation-file-ref-check | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check new file mode 100755 index 000000000000..bc1659900e89 --- /dev/null +++ b/scripts/documentation-file-ref-check | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | # Treewide grep for references to files under Documentation, and report | ||
3 | # non-existing files in stderr. | ||
4 | |||
5 | for f in $(git ls-files); do | ||
6 | for ref in $(grep -ho "Documentation/[A-Za-z0-9_.,~/*+-]*" "$f"); do | ||
7 | # presume trailing . and , are not part of the name | ||
8 | ref=${ref%%[.,]} | ||
9 | |||
10 | # use ls to handle wildcards | ||
11 | if ! ls $ref >/dev/null 2>&1; then | ||
12 | echo "$f: $ref" >&2 | ||
13 | fi | ||
14 | done | ||
15 | done | ||