Permalink
Browse files

Implementing clean command

  • Loading branch information...
1 parent d676433 commit 14993d4458f210bc7c0aeeb48c2c8063c97722d4 @benvanik committed Apr 9, 2012
Showing with 15 additions and 2 deletions.
  1. +1 −1 .gitignore
  2. +14 −1 build/commands/clean_command.py
View
@@ -57,7 +57,7 @@ node_modules/.bin/
# coverage/etc
scratch/
-.gfcache/
+.build-cache/
build-out/
build-gen/
build-bin/
@@ -8,6 +8,7 @@
import argparse
import os
+import shutil
import sys
import build.commands.util as commandutil
@@ -34,6 +35,18 @@ def clean(args, cwd):
build_env = BuildEnvironment(root_path=cwd)
- # TODO(benvanik): delete paths/cache/etc
+ def attempt_delete(path):
+ if os.path.isdir(path):
+ print 'Deleting %s...' % (path)
+ shutil.rmtree(path)
+
+ nuke_paths = [
+ '.build-cache',
+ 'build-out',
+ 'build-gen',
+ 'build-bin',
+ ]
+ for path in nuke_paths:
+ attempt_delete(path)
return True

0 comments on commit 14993d4

Please sign in to comment.