BUG: Failure of custom actions is not reflected in todo.sh exit status.

No further actions are done after cleanup() calls, so the change from "exit" to "return" is safe. Further refactoring of the cleanup() calls is pending.
This commit is contained in:
Ingo Karkat
2010-06-29 11:07:40 +02:00
parent f72c1034ee
commit 38e2b8847f

View File

@@ -250,7 +250,7 @@ die()
cleanup() cleanup()
{ {
[ -f "$TMP_FILE" ] && rm "$TMP_FILE" [ -f "$TMP_FILE" ] && rm "$TMP_FILE"
exit 0 return 0
} }
cleaninput() cleaninput()
@@ -620,7 +620,9 @@ then
elif [ -d "$TODO_ACTIONS_DIR" -a -x "$TODO_ACTIONS_DIR/$action" ] elif [ -d "$TODO_ACTIONS_DIR" -a -x "$TODO_ACTIONS_DIR/$action" ]
then then
"$TODO_ACTIONS_DIR/$action" "$@" "$TODO_ACTIONS_DIR/$action" "$@"
status=$?
cleanup cleanup
exit $status
fi fi
## Only run if $action isn't found in .todo.actions.d ## Only run if $action isn't found in .todo.actions.d