Reland 'Delete stale package_config.json in gclient sync hook' (flutter/engine#57218)
https://github.com/flutter/engine/pull/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.
This commit is contained in:
parent
475d981108
commit
24708c00d4
@ -134,8 +134,10 @@ def delete_config_files():
|
|||||||
gitcmd, cwd=ENGINE_DIR, stderr=subprocess.STDOUT, text=True
|
gitcmd, cwd=ENGINE_DIR, stderr=subprocess.STDOUT, text=True
|
||||||
).splitlines()
|
).splitlines()
|
||||||
for file in files_to_delete:
|
for file in files_to_delete:
|
||||||
print('Deleting %s...' % file)
|
file_path = os.path.join(ENGINE_DIR, file)
|
||||||
os.remove(os.path.join(ENGINE_DIR, file))
|
if os.path.exists(file_path):
|
||||||
|
print('Deleting %s...' % file)
|
||||||
|
os.remove(file_path)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user