atexit callback. If :attr:`Scrim.auto_write` is True write the
        scrim to :attr:`Scrim.path` as :attr:`Scrim.shell`

def on_exit(self):
        '''atexit callback. If :attr:`Scrim.auto_write` is True write the
        scrim to :attr:`Scrim.path` as :attr:`Scrim.shell`'''

        if not all([self.auto_write, self.commands, self.script, self.path]):
            return

        self.write()