diff --git a/.gitignore b/.gitignore index 1519de527..d254d4398 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ tools/esp32-arduino-libs +tools/xtensa-esp-elf tools/xtensa-esp32-elf tools/xtensa-esp32s2-elf tools/xtensa-esp32s3-elf diff --git a/tools/get.exe b/tools/get.exe index 139fcabf1..13f81c367 100644 Binary files a/tools/get.exe and b/tools/get.exe differ diff --git a/tools/get.py b/tools/get.py index 6d191b686..19d48be5c 100755 --- a/tools/get.py +++ b/tools/get.py @@ -233,6 +233,10 @@ def unpack(filename, destination, force_extract, checksum): # noqa: C901 else: print(" Forcing extraction") + if os.path.isdir(os.path.join(destination, rename_to)): + print("Removing existing {0} ...".format(rename_to)) + shutil.rmtree(os.path.join(destination, rename_to), ignore_errors=True) + if filename.endswith("tar.gz"): if not cfile: cfile = tarfile.open(filename, "r:gz") @@ -250,8 +254,6 @@ def unpack(filename, destination, force_extract, checksum): # noqa: C901 if rename_to != dirname: print("Renaming {0} to {1} ...".format(dirname, rename_to)) - if os.path.isdir(rename_to): - shutil.rmtree(rename_to) shutil.move(dirname, rename_to) with open(os.path.join(destination, rename_to, ".package_checksum"), "w") as f: