Skip to content

Commit 06dedb6

Browse files
committed
Improve update esptool PS1
- Now clears destination folders to make sure that the new version it's a clean update. ***NO_CI***
1 parent 9aed88e commit 06dedb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

update-esptool.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ Expand-Archive $outputMac -DestinationPath $env:TEMP -Force > $null
4646
Expand-Archive $outputLinux -DestinationPath $env:TEMP -Force > $null
4747
"OK" | Write-Host -ForegroundColor Green
4848

49+
# clean destination folders
50+
Remove-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath "lib\esptool\esptoolWin" -Resolve) -Include *.* -Force -Recurse
51+
Remove-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath "lib\esptool\esptoolMac\LICENSE" -Resolve) -Include *.* -Force -Recurse
52+
Remove-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath "lib\esptool\esptoolLinux\LICENSE" -Resolve) -Include *.* -Force -Recurse
53+
4954
# copy files to the correct locations
5055
"Copying files to tools folders..." | Write-Host -ForegroundColor White -NoNewline
5156
Move-Item -Path (Join-Path -Path $env:TEMP -ChildPath "esptool-$version-win64\**" -Resolve) -Destination (Join-Path -Path $PSScriptRoot -ChildPath "lib\esptool\esptoolWin" -Resolve)

0 commit comments

Comments
 (0)