import os import shutil from jhbuild.commands import Command, register_command class cmd_clear(Command): name = 'clear' usage_args = '' def run(self, config, options, args): if os.path.exists(config.checkoutroot): shutil.rmtree(config.checkoutroot) if os.path.exists(config.prefix): shutil.rmtree(config.prefix) register_command(cmd_clear)