Peng Ding
commited on
Commit
·
7d7a078
1
Parent(s):
194dea8
include file checker
Browse files- missing_file.sh +21 -0
missing_file.sh
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
partial_filename=".all2all.json"
|
| 4 |
+
directories=$(find . -mindepth 1 -maxdepth 1 -type d)
|
| 5 |
+
|
| 6 |
+
# count how many folders in this dir
|
| 7 |
+
count=$(echo $directories | wc -w)
|
| 8 |
+
|
| 9 |
+
if [ $count -eq 0 ]; then
|
| 10 |
+
echo "No directories found."
|
| 11 |
+
exit 1
|
| 12 |
+
else
|
| 13 |
+
echo "Found $count directories:"
|
| 14 |
+
echo $directories
|
| 15 |
+
fi
|
| 16 |
+
|
| 17 |
+
for dir in $directories; do
|
| 18 |
+
if [ ! -e "$dir"/*"$partial_filename" ]; then
|
| 19 |
+
echo "Directory '$dir' does not contain a file matching '$partial_filename'."
|
| 20 |
+
fi
|
| 21 |
+
done
|