Skip to content

Commit

Permalink
Reland 'Delete stale package_config.json in gclient sync hook' (flutt…
Browse files Browse the repository at this point in the history
…er/engine#57218)

flutter/engine#57195 was reverted because it tried to delete non-existing files. This adds a check to only attempt to delete the file if it exists.
  • Loading branch information
goderbauer authored Dec 16, 2024
1 parent 475d981 commit 24708c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/src/flutter/tools/pub_get_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 24708c0

Please sign in to comment.