From d72c449b13d0b55e3a32a304fe9b7825edac5ff4 Mon Sep 17 00:00:00 2001 From: hedger Date: Wed, 14 Feb 2024 13:51:10 +0000 Subject: [PATCH] scripts: better error handling in update process --- fbt.cmd | 2 +- scripts/toolchain/windows-toolchain-download.ps1 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fbt.cmd b/fbt.cmd index 20432be1c..d8e42f80c 100644 --- a/fbt.cmd +++ b/fbt.cmd @@ -1,5 +1,5 @@ @echo off -call "%~dp0scripts\toolchain\fbtenv.cmd" env +call "%~dp0scripts\toolchain\fbtenv.cmd" env || exit /b set SCONS_EP=python -m SCons diff --git a/scripts/toolchain/windows-toolchain-download.ps1 b/scripts/toolchain/windows-toolchain-download.ps1 index c58b86857..025f8341f 100644 --- a/scripts/toolchain/windows-toolchain-download.ps1 +++ b/scripts/toolchain/windows-toolchain-download.ps1 @@ -21,13 +21,13 @@ if (Test-Path -LiteralPath "$toolchain_target_path") { Write-Host "done!" } -if (Test-path -Path "$toolchain_target_path\..\current") { +if (Test-path -LiteralPath "$toolchain_target_path\..\current") { Write-Host -NoNewline "Unlinking 'current'.." Remove-Item -LiteralPath "$toolchain_target_path\..\current" -Force Write-Host "done!" } -if (!(Test-Path -Path "$toolchain_zip_temp_path" -PathType Leaf)) { +if (!(Test-Path -LiteralPath "$toolchain_zip_temp_path" -PathType Leaf)) { Write-Host -NoNewline "Downloading Windows toolchain.." $wc = New-Object net.webclient $wc.Downloadfile("$toolchain_url", "$toolchain_zip_temp_path") @@ -62,6 +62,7 @@ Write-Host "done!" } catch { Write-Host "An error occurred" Write-Host $_ + Write-Host "Please close VSCode and any other programs that may be using the toolchain and try again." $host.SetShouldExit(1) Exit 1 }