1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-07 07:02:53 +03:00

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
This commit is contained in:
Wez Furlong
2019-05-03 15:52:39 -07:00
committed by Facebook Github Bot
parent 4725faf983
commit 7b7e3d8b06

View File

@@ -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)