1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Fix get.py for the case when path doesn't exist

This commit is contained in:
Ivan Grokhotkov 2015-10-30 17:49:51 +03:00
parent 444a37987e
commit ab6a480ab0

View File

@ -57,7 +57,8 @@ def unpack(filename, destination):
rename_to = re.match(r'^([a-z][^\-]*\-*)+', dirname).group(0).encode('ascii').strip('-')
if rename_to != dirname:
print('Renaming {0} to {1}'.format(dirname, rename_to))
shutil.rmtree(rename_to)
if os.path.isdir(rename_to):
shutil.rmtree(rename_to)
shutil.move(dirname, rename_to)
def get_tool(tool):