Skip to content

Commit 8a30f57

Browse files
Update checks.sh
1 parent 9da9b7f commit 8a30f57

File tree

1 file changed

+24
-77
lines changed

1 file changed

+24
-77
lines changed

src/checks.sh

Lines changed: 24 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,34 @@
1-
# Check for directories
2-
if [ ! -d "_just" ]; then
3-
echo ""
4-
echo "----------------"
5-
echo ""
6-
echo "_just Checks:"
7-
echo ""
8-
echo " ✕ (root)/_just/"
9-
echo " ✕ (root)/_just/js/"
10-
echo " ✕ (root)/_just/style/"
11-
echo " ✕ (root)/_just/404.html"
12-
echo ""
13-
echo "End _just Checks"
14-
echo ""
15-
echo "----------------"
16-
echo ""
17-
echo "Error: The _just directory is missing in the root. Please create it to proceed." >&2
18-
exit 1
19-
fi
20-
if [ ! -d "_just/js" ]; then
21-
echo ""
22-
echo "----------------"
23-
echo ""
24-
echo "_just Checks:"
25-
echo ""
26-
echo " ✓ (root)/_just/"
27-
echo " ✕ (root)/_just/js/"
28-
echo " ? (root)/_just/style/"
29-
echo " ? (root)/_just/404.html"
30-
echo ""
31-
echo "End _just Checks"
32-
echo ""
33-
echo "----------------"
34-
echo ""
35-
echo "Error: The js directory is missing in the _just directory. Please create it to proceed." >&2
36-
exit 1
37-
fi
38-
if [ ! -d "_just/style" ]; then
39-
echo ""
40-
echo "----------------"
41-
echo ""
42-
echo "_just Checks:"
43-
echo ""
44-
echo " ✓ (root)/_just/"
45-
echo " ✓ (root)/_just/js/"
46-
echo " ✕ (root)/_just/style/"
47-
echo " ? (root)/_just/404.html"
48-
echo ""
49-
echo "End _just Checks"
50-
echo ""
51-
echo "----------------"
52-
echo ""
53-
echo "Error: The style directory is missing in the _just directory. Please create it to proceed." >&2
54-
exit 1
55-
fi
1+
# Directory & File Checks
2+
for dir in "_just" "_just/js" "_just/style"; do
3+
if [ ! -d "$dir" ]; then
4+
echo -e "\n----------------\n\n_just Checks:\n"
5+
echo " $( [ -d "_just" ] && echo "" || echo "" ) (root)/_just/"
6+
echo " $( [ -d "_just/js" ] && echo "" || echo "" ) (root)/_just/js/"
7+
echo " $( [ -d "_just/style" ] && echo "" || echo "" ) (root)/_just/style/"
8+
echo " ? (root)/_just/404.html\n"
9+
echo "End _just Checks\n"
10+
echo "----------------\n"
11+
echo "Error: The $dir directory is missing. Please create it to proceed." >&2
12+
exit 1
13+
fi
14+
done
15+
5616
if [ ! -f "_just/404.html" ]; then
57-
echo ""
58-
echo "----------------"
59-
echo ""
60-
echo "_just Checks:"
61-
echo ""
17+
echo -e "\n----------------\n\n_just Checks:\n"
6218
echo " ✓ (root)/_just/"
6319
echo " ✓ (root)/_just/js/"
6420
echo " ✓ (root)/_just/style/"
65-
echo " ✕ (root)/_just/404.html"
66-
echo ""
67-
echo "End _just Checks"
68-
echo ""
69-
echo "----------------"
70-
echo ""
21+
echo " ✕ (root)/_just/404.html\n"
22+
echo "End _just Checks\n"
23+
echo "----------------\n"
7124
echo "Error: The _just/404.html file is missing." >&2
7225
exit 1
7326
fi
74-
echo ""
75-
echo "----------------"
76-
echo ""
77-
echo "_just Checks:"
78-
echo ""
27+
28+
echo -e "\n----------------\n\n_just Checks:\n"
7929
echo " ✓ (root)/_just/"
8030
echo " ✓ (root)/_just/js/"
8131
echo " ✓ (root)/_just/style/"
82-
echo " ✓ (root)/_just/404.html"
83-
echo ""
84-
echo "End _just Checks"
85-
echo ""
86-
echo "----------------"
87-
echo ""
32+
echo " ✓ (root)/_just/404.html\n"
33+
echo "End _just Checks\n"
34+
echo "----------------\n"

0 commit comments

Comments
 (0)