未验证 提交 52b976c3 编写于 作者: J Jason Simmons 提交者: GitHub

Extract the prebuilt Dart SDK to a temp directory and then move it after the...

Extract the prebuilt Dart SDK to a temp directory and then move it after the extraction completes (#27569)

* Extract the prebuilt Dart SDK to a temp directory and then move it after the extraction completes

This ensures that the GN script will not see an invalid Dart SDK at the
expected path if the extract fails.

* Add os_arch to temp extraction path
Co-authored-by: NZachary Anderson <zanderso@users.noreply.github.com>
上级 a1ed81a3
......@@ -150,7 +150,9 @@ def ExtractDartSDK(archive, os_name, arch, verbose):
if os.path.isdir(dart_sdk):
shutil.rmtree(dart_sdk)
extract_dest = os.path.join(FLUTTER_PREBUILTS_DIR, os_arch)
extract_dest = os.path.join(FLUTTER_PREBUILTS_DIR, os_arch, 'temp')
if os.path.isdir(extract_dest):
shutil.rmtree(extract_dest)
os.makedirs(extract_dest, exist_ok=True)
if verbose:
......@@ -159,6 +161,8 @@ def ExtractDartSDK(archive, os_name, arch, verbose):
with ZipFileWithPermissions(archive, "r") as z:
z.extractall(extract_dest)
shutil.move(os.path.join(extract_dest, 'dart-sdk'), dart_sdk)
def PrintFileIfSmall(file):
if not os.path.isfile(file):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册