From 9dba36d997bd742960cb23b33b2c2d2a411001c4 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 16 Dec 2024 09:56:52 -0800 Subject: [PATCH] Reland 'Delete stale package_config.json in gclient sync hook' --- tools/pub_get_offline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/pub_get_offline.py b/tools/pub_get_offline.py index 154c08e6d55c0..c56d74f805727 100644 --- a/tools/pub_get_offline.py +++ b/tools/pub_get_offline.py @@ -134,8 +134,10 @@ def delete_config_files(): gitcmd, cwd=ENGINE_DIR, stderr=subprocess.STDOUT, text=True ).splitlines() for file in files_to_delete: - print('Deleting %s...' % file) - os.remove(os.path.join(ENGINE_DIR, file)) + file_path = os.path.join(ENGINE_DIR, file) + if os.path.exists(file_path): + print('Deleting %s...' % file) + os.remove(file_path) def main():