Commit 5e3d6786 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

fbcode_builder: getdeps: add clean command

Summary:
This cleans up the scratch dir, removing everything except
for downloaded tarballs.

Reviewed By: simpkins

Differential Revision: D14781328

fbshipit-source-id: 9304e44a268cf7996c5e572a2eca219aefbf4b46
parent 2fbf3798
......@@ -112,16 +112,27 @@ class ListDepsCmd(SubCmd):
)
def clean_dirs(opts):
for d in ["build", "installed", "extracted", "shipit"]:
d = os.path.join(opts.scratch_dir, d)
print("Cleaning %s..." % d)
if os.path.exists(d):
shutil.rmtree(d)
@cmd("clean", "clean up the scratch dir")
class CleanCmd(SubCmd):
def run(self, args):
opts = setup_build_options(args)
clean_dirs(opts)
@cmd("build", "build a given project")
class BuildCmd(SubCmd):
def run(self, args):
opts = setup_build_options(args)
if args.clean:
for d in ["build", "installed", "extracted", "shipit"]:
d = os.path.join(opts.scratch_dir, d)
print("Cleaning %s..." % d)
if os.path.exists(d):
shutil.rmtree(d)
clean_dirs(opts)
manifest = load_project(opts, args.project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment