Permalink
Browse files

refactoring: made code more readable.

  • Loading branch information...
1 parent 99b91e9 commit 05cd3aaa37a5aeead53901ea8ce3e09c07ccd336 Jason Jackson committed Jan 24, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 nanny.py
View
@@ -270,16 +270,15 @@ def get_all_deps(client, nanny_file):
def deps(client, args):
shutil.rmtree("_deps_tmp", ignore_errors=True)
-
if not os.path.exists("NANNY"):
raise NannyFileNotFound("No NANNY file found. Aborting.")
- if not os.path.exists("_deps/.contents_valid"):
- shutil.rmtree("_deps", ignore_errors=True)
-
- if os.path.exists("_deps"):
+ if os.path.exists("_deps/.contents_valid"):
#Temporarily retain any state from the previous `nanny deps` execution.
shutil.move("_deps", "_deps_tmp")
+ else:
+ #Folder is corrupt or non-existent. Delete it.
+ shutil.rmtree("_deps", ignore_errors=True)
os.mkdir("_deps")
os.mkdir("_deps/_actual")

0 comments on commit 05cd3aa

Please sign in to comment.