File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,17 @@ echo ""
88echo " Generated: $( date +" %Y-%m-%dT%H:%M:%S%z" ) "
99echo " "
1010
11+ source_directory=" $( pwd) /src"
1112total_sql_files=0
1213documented_sql_files=0
1314
15+ if [ ! -d $source_directory ]; then
16+ echo " error: source directory does not exist: ${source_directory} "
17+ exit 2
18+ fi
19+
1420# Check .sql files
15- for file in $( find src -name " *.sql" -not -name " *_test.sql" | sort) ; do
21+ for file in $( find $source_directory -name " *.sql" -not -name " *_test.sql" | sort) ; do
1622 # Skip auto-generated files
1723 if grep -q " ^-- AUTOMATICALLY GENERATED FILE" " $file " 2> /dev/null; then
1824 echo " - $file : ⊘ Auto-generated (skipped)"
3339total_template_files=0
3440documented_template_files=0
3541
36- for file in $( find src -name " *.template" | sort) ; do
42+ for file in $( find $source_directory -name " *.template" | sort) ; do
3743 total_template_files=$(( total_template_files + 1 ))
3844
3945 if grep -q " ^--! @brief" " $file " 2> /dev/null; then
Original file line number Diff line number Diff line change @@ -8,14 +8,20 @@ PGPORT=${PGPORT:-7432}
88PGUSER=${PGUSER:- cipherstash}
99PGPASSWORD=${PGPASSWORD:- password}
1010PGDATABASE=${PGDATABASE:- postgres}
11+ source_directory=" $( pwd) /src"
1112
1213echo " Validating SQL syntax for all documented files..."
1314echo " "
1415
1516errors=0
1617validated=0
1718
18- for file in $( find src -name " *.sql" -not -name " *_test.sql" | sort) ; do
19+ if [ ! -d $source_directory ]; then
20+ echo " error: source directory does not exist: ${source_directory} "
21+ exit 2
22+ fi
23+
24+ for file in $( find $source_directory -name " *.sql" -not -name " *_test.sql" | sort) ; do
1925 echo -n " Validating $file ... "
2026
2127 # Capture both stdout and stderr
Original file line number Diff line number Diff line change 66echo " Validating required Doxygen tags..."
77echo " "
88
9+ source_directory=" $( pwd) /src"
910errors=0
1011warnings=0
1112
12- for file in $( find src -name " *.sql" -not -name " *_test.sql" ) ; do
13+ if [ ! -d $source_directory ]; then
14+ echo " error: source directory does not exist: ${source_directory} "
15+ exit 2
16+ fi
17+
18+ for file in $( find $source_directory -name " *.sql" -not -name " *_test.sql" ) ; do
1319 # Skip auto-generated files
1420 if grep -q " ^-- AUTOMATICALLY GENERATED FILE" " $file " 2> /dev/null; then
1521 continue
@@ -55,7 +61,7 @@ for file in $(find src -name "*.sql" -not -name "*_test.sql"); do
5561done
5662
5763# Also check template files
58- for file in $( find src -name " *.template" ) ; do
64+ for file in $( find $source_directory -name " *.template" ) ; do
5965 functions=$( grep -n " ^CREATE FUNCTION" " $file " 2> /dev/null | cut -d: -f1 || echo " " )
6066
6167 for line_no in $functions ; do
You can’t perform that action at this time.
0 commit comments