Allow users to define a batch cleanup function which is called when a batch file finishes or aborts.

r2802 | ffr | 2009-08-11 12:25:26 +1000 (Tue, 11 Aug 2009) | 2 lines
This commit is contained in:
Ferdi Franceschini
2009-08-11 12:25:26 +10:00
committed by Douglas Clowes
parent 86d5b0fef9
commit c58ee9fbcb

View File

@@ -52,3 +52,15 @@ proc ::event::waitfor {sobj args} {
namespace import ::event::waitfor
publish waitfor user
namespace eval ::batch::call_cleanup { }
proc ::batch::cleanup {} {}
##
# @brief Calls a user defined cleanup script when a batch file ends or is aborted
# The cleanup script must be called ::batch::call_cleanup
proc ::batch::call_cleanup {} {
::batch::cleanup
proc ::batch::cleanup {} {}
}
publish ::batch::call_cleanup user
scriptcallback connect exe BATCHEND ::batch::call_cleanup