Skip to content

Commit 5c15311

Browse files
fix warnings check script
1 parent f74b96a commit 5c15311

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
#!/bin/zsh
22

3-
source ~/.zprofile
4-
5-
TRAPZERR() {
6-
datetime=$(date +%Y-%m-%d\ %H\:%M\:%S)
7-
echo "Problem running 'check_pandas_warning.sh'" | /usr/bin/mail -s "FUTP Problem running 'check_pandas_warning.sh'" $PYSYS_EMAIL
8-
}
9-
103
# Search for pattern and capture results
11-
RESULTS=$(grep -rnE 'FutureWarning|DeprecationWarning|ChainedAssignmentError' "$ECHO_PATH" 2>/dev/null)
4+
RESULTS=$(/usr/bin/find "$ECHO_PATH" -type f -name "*.log" -exec /usr/bin/grep -E 'FutureWarning|DeprecationWarning|ChainedAssignmentError' /dev/null {} +)
5+
6+
#echo "RESULTS=[$RESULTS]" >&2
127

138
# Exit silently if nothing found
149
if [[ -z "$RESULTS" ]]; then
1510
exit 0
1611
fi
1712

18-
# Compose and send email
19-
SUBJECT="Future/Deprecation Warning instances found"
20-
BODY="$RESULTS"
13+
SUBJECT="Future/Deprecation/ChainedAssignment Warning instances found"
14+
15+
#echo "$ECHO_PATH=[$ECHO_PATH] SUBJECT=[$SUBJECT] PYSYS_EMAIL=[$PYSYS_EMAIL]" >&2
16+
#echo "HOME=[$HOME] USER=[$USER] LOGNAME=[$LOGNAME]" >&2
2117

22-
echo "$BODY" | /usr/bin/mail -s "$SUBJECT" "$PYSYS_EMAIL"
18+
echo "$RESULTS" | /usr/bin/mail -v -s $SUBJECT $PYSYS_EMAIL
19+
#echo "mail exit code: $?" >&2

0 commit comments

Comments
 (0)