File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Usage: ./scripts/check-for-ejs-duplicates.sh <directory>
4
+ # Examples:
5
+ # ./scripts/check-for-ejs-duplicates.sh frameworks/react-cra
6
+ # ./scripts/check-for-ejs-duplicates.sh frameworks/solid
7
+
8
+ # Check if directory parameter is provided
9
+ if [ -z " $1 " ]; then
10
+ echo " Usage: $0 <directory>"
11
+ exit 1
12
+ fi
13
+
14
+ # The directory to search in
15
+ DIR=" $1 "
16
+
17
+ # Find all files that do NOT have .ejs extension
18
+ find " $DIR " -type f ! -name " *.ejs" | while read -r file; do
19
+ # Get the directory and filename
20
+ file_dir=$( dirname " $file " )
21
+ file_name=$( basename " $file " )
22
+
23
+ # Check if a .ejs version exists in the same directory
24
+ ejs_file=" ${file_dir} /${file_name} .ejs"
25
+
26
+ if [ -f " $ejs_file " ]; then
27
+ echo " Found matching pair: $file has corresponding $ejs_file "
28
+ fi
29
+ done
You can’t perform that action at this time.
0 commit comments