From 3fdbb4bfbb0c4d1c58a8288a34686804a49c5b6c Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 9 Dec 2014 09:44:24 +0000 Subject: mach clean-snapshots: better no-op output --- python/servo/bootstrap_commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/servo/bootstrap_commands.py') diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index e0cff7097de..417c5791242 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -164,17 +164,20 @@ class MachCommands(CommandBase): cargo_current = self.cargo_build_id() print("Current Rust version: " + rust_current) print("Current Cargo version: " + cargo_current) - action = "Removing " if force else "Would remove " + removing_anything = False for current, base in [(rust_current, "rust"), (cargo_current, "cargo")]: base = path.join(self.context.sharedir, base) for name in os.listdir(base): if name != current: + removing_anything = True name = path.join(base, name) if force: print("Removing " + name) shutil.rmtree(name) else: print("Would remove " + name) - if not force: + if not removing_anything: + print("Nothing to remove.") + elif not force: print("Nothing done. " "Run `./mach clean-snapshots -f` to actually remove.") -- cgit v1.2.3