Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5ecda3a

Browse files
lucasssvazgithub-actions[bot]pre-commit-ci-lite[bot]
authored
fix(get.py): Remove existing files before extracting (#10247)
* fix(get.py): Remove existing files before extracting * change(tools): Push generated binaries to PR * ci(pre-commit): Apply automatic fixes * change(tools): Push generated binaries to PR --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 7633653 commit 5ecda3a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tools/esp32-arduino-libs
2+
tools/xtensa-esp-elf
23
tools/xtensa-esp32-elf
34
tools/xtensa-esp32s2-elf
45
tools/xtensa-esp32s3-elf

‎tools/get.exe‎

80 Bytes
Binary file not shown.

‎tools/get.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ def unpack(filename, destination, force_extract, checksum): # noqa: C901
233233
else:
234234
print(" Forcing extraction")
235235

236+
if os.path.isdir(os.path.join(destination, rename_to)):
237+
print("Removing existing {0} ...".format(rename_to))
238+
shutil.rmtree(os.path.join(destination, rename_to), ignore_errors=True)
239+
236240
if filename.endswith("tar.gz"):
237241
if not cfile:
238242
cfile = tarfile.open(filename, "r:gz")
@@ -250,8 +254,6 @@ def unpack(filename, destination, force_extract, checksum): # noqa: C901
250254

251255
if rename_to != dirname:
252256
print("Renaming {0} to {1} ...".format(dirname, rename_to))
253-
if os.path.isdir(rename_to):
254-
shutil.rmtree(rename_to)
255257
shutil.move(dirname, rename_to)
256258

257259
with open(os.path.join(destination, rename_to, ".package_checksum"), "w") as f:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /