From ff92cdaaaf8557cdc9f59683b120471bda1c5899 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 29 Mar 2018 10:42:55 -0700 Subject: [PATCH] clean-npm-cache: Use islink to check node_modules. Very old Zulip deployments might have node_modules be an actual directory, which we should ignore for the purposes of garbage-collection. --- scripts/lib/clean-npm-cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/clean-npm-cache b/scripts/lib/clean-npm-cache index 69466a5abf..ad0df17a30 100755 --- a/scripts/lib/clean-npm-cache +++ b/scripts/lib/clean-npm-cache @@ -41,7 +41,7 @@ def get_caches_in_use(threshold_days): for setup_dir in setups_to_check: node_modules_link_path = os.path.join(setup_dir, "node_modules") - if not os.path.exists(node_modules_link_path): + if not os.path.islink(node_modules_link_path): # If 'package.json' file doesn't exist then no node_modules # cache is associated with this setup. continue