diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-04 09:00:02 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-04 09:00:02 (GMT) |
commit | 2f841982bf919d7f4de668ae74e9b41420cd42b1 (patch) | |
tree | 0cabbeba7a083683923777d5588da1e3cc8a3434 /scripts | |
parent | 84a6268246101e489a4d199478650e34c60eb1d3 (diff) |
Make clear not fail if the dirs does not exist.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/clear.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/clear.py b/scripts/clear.py index 78d0475..cc25e34 100644 --- a/scripts/clear.py +++ b/scripts/clear.py @@ -1,3 +1,4 @@ +import os import shutil from jhbuild.commands import Command, register_command @@ -8,7 +9,10 @@ class cmd_clear(Command): usage_args = '' def run(self, config, options, args): - shutil.rmtree(config.checkoutroot) - shutil.rmtree(config.prefix) + if os.path.exists(config.checkoutroot): + shutil.rmtree(config.checkoutroot) + + if os.path.exists(config.prefix): + shutil.rmtree(config.prefix) register_command(cmd_clear) |