Teardown task for entire psake script

106 views
Skip to first unread message

Michael Di Nicola

unread,
Sep 20, 2012, 8:53:32 PM9/20/12
to psake...@googlegroups.com
Hi,

I would like to specify a task that will always run when all psake tasks have finished, even if an error occurs, which would do some cleanup.
I am looking for something similar to the task teardown, but at the end of all tasks instead of every task.

An example is:

Task default -Depends A, B, C, Clean

Task A {
    "A"
}

Task B {
    throw "I failed"
}

Task C {
   "C"
}

Task Cleanup {
  "Cleanup"
}

In this scenario, Task C should not be run, because Task B caused an error.  However, Task Cleanup should still always run.

Does anyone have any suggestions on how to do this, or if it is even possible?
Reply all
Reply to author
Forward
0 new messages