File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## Unreleased
9
9
10
+ ### Added
11
+
12
+ - The output from ` dapp build ` now uses color to differentiate warnings and errors
13
+
10
14
### Changed
11
15
12
16
- Dapp remappings ignores non-directories in ` DAPP_LIB `
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ info() {
27
27
echo >&2 " $FLAGS " " ${0##*/ } : $ARGS "
28
28
}
29
29
30
+ colorize () {
31
+ awk ' {
32
+ gsub("Warning:", "\033[1;33m&\033[0m");
33
+ gsub(".*Error:", "\033[1;31m&\033[0m");
34
+ print }'
35
+ }
36
+
30
37
cd " $DAPP_ROOT "
31
38
32
39
# use a custom path if DAPP_SOLC is set
@@ -68,7 +75,7 @@ if [[ -z "$DAPP_BUILD_LEGACY" && -z "$DAPP_BUILD_EXTRACT" ]]; then
68
75
69
76
# pipe errors to stderr
70
77
jq -r ' if .errors then .errors | map(."formattedMessage") | @sh else empty end' " $DAPP_JSON " \
71
- | sed -e " s/' //g" -e " s/'//g" 1>&2
78
+ | sed -e " s/' //g" -e " s/'//g" -e ' s/\\\(.\)\\/\1 /g ' | colorize 1>&2
72
79
# if sources is empty, the compilation failed
73
80
[[ $( jq -r ' .sources' " $DAPP_JSON " ) = " null" || $( jq -r ' .sources' " $DAPP_JSON " ) = {} ]] && exit 1 || exit 0
74
81
You can’t perform that action at this time.
0 commit comments