mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-22 09:24:28 +03:00
scripts: better error handling in update process
This commit is contained in:
parent
d70bcfdfff
commit
d72c449b13
2
fbt.cmd
2
fbt.cmd
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
call "%~dp0scripts\toolchain\fbtenv.cmd" env
|
call "%~dp0scripts\toolchain\fbtenv.cmd" env || exit /b
|
||||||
|
|
||||||
set SCONS_EP=python -m SCons
|
set SCONS_EP=python -m SCons
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@ if (Test-Path -LiteralPath "$toolchain_target_path") {
|
|||||||
Write-Host "done!"
|
Write-Host "done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-path -Path "$toolchain_target_path\..\current") {
|
if (Test-path -LiteralPath "$toolchain_target_path\..\current") {
|
||||||
Write-Host -NoNewline "Unlinking 'current'.."
|
Write-Host -NoNewline "Unlinking 'current'.."
|
||||||
Remove-Item -LiteralPath "$toolchain_target_path\..\current" -Force
|
Remove-Item -LiteralPath "$toolchain_target_path\..\current" -Force
|
||||||
Write-Host "done!"
|
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.."
|
Write-Host -NoNewline "Downloading Windows toolchain.."
|
||||||
$wc = New-Object net.webclient
|
$wc = New-Object net.webclient
|
||||||
$wc.Downloadfile("$toolchain_url", "$toolchain_zip_temp_path")
|
$wc.Downloadfile("$toolchain_url", "$toolchain_zip_temp_path")
|
||||||
@ -62,6 +62,7 @@ Write-Host "done!"
|
|||||||
} catch {
|
} catch {
|
||||||
Write-Host "An error occurred"
|
Write-Host "An error occurred"
|
||||||
Write-Host $_
|
Write-Host $_
|
||||||
|
Write-Host "Please close VSCode and any other programs that may be using the toolchain and try again."
|
||||||
$host.SetShouldExit(1)
|
$host.SetShouldExit(1)
|
||||||
Exit 1
|
Exit 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user