-
Notifications
You must be signed in to change notification settings - Fork 7
/
y-init
executable file
·31 lines (24 loc) · 917 Bytes
/
y-init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Performs hybris initialize and analyses errors
#
# source: https://github.com/sergaks/y-scripts
CONSOLE_OUTPUT_FILE="/tmp/hybris-init.log"
y-ant all initialize "$@" | tee "$CONSOLE_OUTPUT_FILE"
# check if initialize was actually run
if ( ! grep -q "Initialize system" $CONSOLE_OUTPUT_FILE ); then
echo "======================================"
echo "FAILED (Initialize system was not actually performed, see ant console output for details)"
exit 1
fi
FAILURES=`cat "$CONSOLE_OUTPUT_FILE" | sed -n "/Initialize system/,/FINISHED/p" | grep -e "WARN\|ERROR"`
ERRORS=`echo "$FAILURES" | grep "ERROR"`
if [ -n "$ERRORS" ]; then
echo "======================================"
echo "$FAILURES"
echo "======================================"
echo "FAILED (see errors and warnings above)"
exit 1
else
echo "======================================"
echo "SUCCESS (no errors)"
fi