jamesob / desk

A lightweight workspace manager for the shell
MIT License
2.54k stars 111 forks source link

Ability to run a clean up script when exiting a desk session #69

Closed greyhoundforty closed 4 years ago

greyhoundforty commented 8 years ago

It would be great if there was a way to run a script when using the exit command to leave a desk session. For instance I have a desk session setup when I am working on some specific github repos for work and sometimes I forgot to run the git add and commit commands before leaving my desk session. Not really a huge deal as I can still run them from a normal shell, but would be useful to run a cleanup script upon exit.

rnewton commented 8 years ago

Could you do something like trap myCleanupFunc EXIT? And define the stuff you want to do on cleanup in myCleanupFunc

jdloft commented 7 years ago

@rnewton trap myCleanupFunc EXIT would run the function once the desk script is run on desk initialization.