@@ -29,7 +29,7 @@ MY_DATE="2022-12-17"
2929MY_URL=" https://github.com/devilbox/watcherd"
3030MY_AUTHOR=
" cytopia <[email protected] >" 3131MY_GPGKEY=" 0xA02C56F0"
32- MY_VERSION=" 1.0.3 "
32+ MY_VERSION=" 1.0.4 "
3333MY_LICENSE=" MIT"
3434
3535# Default settings
@@ -130,17 +130,14 @@ function action() {
130130 action=" ${action//% p/ ${directory} } "
131131 action=" ${action//% n/ ${name} } "
132132
133- if OUTPUT= " $( eval " ${action} " 2>&1 ) " ; then
133+ if eval " ${action} " ; then
134134 if [ " ${verbose} " -gt " 0" ]; then
135135 printf " %s: [%s] [OK] %s succeeded: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " ${info} " " ${directory} "
136136 fi
137137 return 0
138138 else
139139 printf " %s: [%s] [ERR] %s failed: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " ${info} " " ${directory} " >&2
140140 printf " %s: [%s] [ERR] %s failed: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " ${info} " " ${action} " >&2
141- if [ -n " ${OUTPUT} " ]; then
142- printf " %s: [%s] [ERR] %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " ${OUTPUT} " >&2
143- fi
144141 return 1
145142 fi
146143}
@@ -153,16 +150,13 @@ function trigger() {
153150 # Only run trigger when command has been specified (not empty)
154151 if [ -n " ${action} " ]; then
155152 if [ " ${changes} " -eq " 1" ]; then
156- if OUTPUT= " $( eval " ${action} " 2>&1 ) " ; then
153+ if eval " ${action} " ; then
157154 if [ " ${verbose} " -gt " 0" ]; then
158155 printf " %s: [%s] [OK] %s succeeded: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRIGGER" " ${action} "
159156 fi
160157 return 0
161158 else
162159 printf " %s: [%s] [ERR] %s failed: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRIGGER" " ${action} " >&2
163- if [ -n " ${OUTPUT} " ]; then
164- printf " %s: [%s] [ERR] %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " ${OUTPUT} " >&2
165- fi
166160 # Also return 0 here in order to not abort the loop
167161 return 0
168162 fi
0 commit comments