mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
fbtenv: link toolchain to 'current' on Windows
This commit is contained in:
@@ -24,17 +24,17 @@ set "FBT_TOOLCHAIN_ROOT=%FBT_TOOLCHAIN_PATH%\toolchain\x86_64-windows"
|
|||||||
set "FBT_TOOLCHAIN_VERSION_FILE=%FBT_TOOLCHAIN_ROOT%\VERSION"
|
set "FBT_TOOLCHAIN_VERSION_FILE=%FBT_TOOLCHAIN_ROOT%\VERSION"
|
||||||
|
|
||||||
if not exist "%FBT_TOOLCHAIN_ROOT%" (
|
if not exist "%FBT_TOOLCHAIN_ROOT%" (
|
||||||
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "%FBT_TOOLCHAIN_VERSION_FILE%" (
|
if not exist "%FBT_TOOLCHAIN_VERSION_FILE%" (
|
||||||
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
||||||
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
|
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
|
||||||
echo FBT: starting toolchain upgrade process..
|
echo FBT: starting toolchain upgrade process..
|
||||||
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
|
||||||
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ if (Test-Path -LiteralPath "$toolchain_target_path") {
|
|||||||
Remove-Item -LiteralPath "$toolchain_target_path" -Force -Recurse
|
Remove-Item -LiteralPath "$toolchain_target_path" -Force -Recurse
|
||||||
Write-Host "done!"
|
Write-Host "done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Test-path -Path "$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 -Path "$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
|
||||||
@@ -42,6 +49,8 @@ Add-Type -Assembly "System.IO.Compression.Filesystem"
|
|||||||
|
|
||||||
Write-Host -NoNewline "moving.."
|
Write-Host -NoNewline "moving.."
|
||||||
Move-Item -LiteralPath "$toolchain_dist_temp_path" -Destination "$toolchain_target_path" -Force
|
Move-Item -LiteralPath "$toolchain_dist_temp_path" -Destination "$toolchain_target_path" -Force
|
||||||
|
Write-Host -NoNewline "linking to 'current'.."
|
||||||
|
cmd /c mklink /J "$toolchain_target_path\..\current" "$toolchain_target_path"
|
||||||
Write-Host "done!"
|
Write-Host "done!"
|
||||||
|
|
||||||
Write-Host -NoNewline "Cleaning up temporary files.."
|
Write-Host -NoNewline "Cleaning up temporary files.."
|
||||||
|
|||||||
Reference in New Issue
Block a user