diff options
author | tigercosmos <phy.tiger@gmail.com> | 2018-01-08 03:19:46 +0800 |
---|---|---|
committer | tigercosmos <phy.tiger@gmail.com> | 2018-01-18 16:47:23 +0800 |
commit | ebf8348aa2d084b1afab074bd1011d95fb3332f6 (patch) | |
tree | f7f9e309eb821d7df7be6e42b4703e8be9572801 /python | |
parent | 1f6a864ab5372fe4f59b1a4c3db7cf8e7a79b06d (diff) | |
download | servo-ebf8348aa2d084b1afab074bd1011d95fb3332f6.tar.gz servo-ebf8348aa2d084b1afab074bd1011d95fb3332f6.zip |
auto clean cache
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/bootstrap_commands.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index ccc971e5b57..90391785698 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -169,10 +169,7 @@ class MachCommands(CommandBase): @CommandArgument('--keep', default='1', help='Keep up to this many most recent dependencies') - @CommandArgument('--custom-path', '-c', - action='store_true', - help='Get Cargo path from CARGO_HOME environment variable') - def clean_cargo_cache(self, force=False, show_size=False, keep=None, custom_path=False): + def clean_cargo_cache(self, force=False, show_size=False, keep=None): def get_size(path): if os.path.isfile(path): return os.path.getsize(path) / (1024 * 1024.0) @@ -189,7 +186,7 @@ class MachCommands(CommandBase): 'git': {}, } import toml - if os.environ.get("CARGO_HOME", "") and custom_path: + if os.environ.get("CARGO_HOME", ""): cargo_dir = os.environ.get("CARGO_HOME") else: cargo_dir = path.join(self.context.topdir, ".cargo") @@ -317,7 +314,10 @@ class MachCommands(CommandBase): print("Removing `{}`{} package from {}".format(*print_msg)) for crate_path in crate_paths: if os.path.exists(crate_path): - delete(crate_path) + try: + delete(crate_path) + except: + print("Delete %s failed!" % crate_path) else: print("Would remove `{}`{} package from {}".format(*print_msg)) |