I wrote a build script that traps kill signals so I can run some clean up code, and it does not work when I ‘Cancel Build’ in sublime text. Here’s the important part of the build script.
#!/bin/bash
function clean_up {
echo "all done"
}
trap clean_up SIGHUP SIGINT SIGTERM SIGKILL
but, when I cancel the build in sublime text, I don’t get the trap. All I see in the build window is:
[Cancelled]
Is there a way I can write a build script so that when it’s cancelled in Sublime Text I can ‘clean up’ ?