Skip to content

Commit

Permalink
fix pwsh support
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Apr 18, 2021
1 parent 0665c4e commit bd925bc
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ echo found Powershell && goto start
set powershell=pwsh
where pwsh > nul 2>&1
if ERRORLEVEL 1 goto :nopwsh
set PWSHV7=1
echo found pwsh && goto start
:nopwsh
echo Powershell or pwsh not found, please install it.
Expand Down Expand Up @@ -72,13 +73,17 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 (
ECHO Downloading rpclib
ECHO *****************************************************************************************
@echo on
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }"
if "%PWSHV7%" == "" (
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }"
) else (
%powershell% -command "iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip"
)
@echo off

REM //remove any previous versions
rmdir external\rpclib /q /s

%powershell% -command "& { Expand-Archive -Path external\rpclib.zip -DestinationPath external\rpclib }"
%powershell% -command "Expand-Archive -Path external\rpclib.zip -DestinationPath external\rpclib"
del external\rpclib.zip /q

REM //Don't fail the build if the high-poly car is unable to be downloaded
Expand Down Expand Up @@ -137,10 +142,14 @@ IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.2.0 (
@echo on
REM %powershell% -command "& { Start-BitsTransfer -Source https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip -Destination suv_download_tmp\car_assets.zip }"
REM %powershell% -command "& { (New-Object System.Net.WebClient).DownloadFile('https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip', 'suv_download_tmp\car_assets.zip') }"
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip -OutFile suv_download_tmp\car_assets.zip }"
if "%PWSHV7%" == "" (
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip -OutFile suv_download_tmp\car_assets.zip }"
) else (
%powershell% -command "iwr https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip -OutFile suv_download_tmp\car_assets.zip"
)
@echo off
rmdir /S /Q Unreal\Plugins\AirSim\Content\VehicleAdv\SUV
%powershell% -command "& { Expand-Archive -Path suv_download_tmp\car_assets.zip -DestinationPath Unreal\Plugins\AirSim\Content\VehicleAdv }"
%powershell% -command "Expand-Archive -Path suv_download_tmp\car_assets.zip -DestinationPath Unreal\Plugins\AirSim\Content\VehicleAdv"
rmdir suv_download_tmp /q /s

REM //Don't fail the build if the high-poly car is unable to be downloaded
Expand All @@ -154,9 +163,13 @@ IF NOT EXIST Unreal\Plugins\AirSim\Content\VehicleAdv\SUV\v1.2.0 (
REM //---------- get Eigen library ----------
IF NOT EXIST AirLib\deps mkdir AirLib\deps
IF NOT EXIST AirLib\deps\eigen3 (
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip -OutFile eigen3.zip }"
%powershell% -command "& { Expand-Archive -Path eigen3.zip -DestinationPath AirLib\deps }"
%powershell% -command "& { Move-Item -Path AirLib\deps\eigen* -Destination AirLib\deps\del_eigen }"
if "%PWSHV7%" == "" (
%powershell% -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip -OutFile eigen3.zip }"
) else (
%powershell% -command "iwr https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip -OutFile eigen3.zip"
)
%powershell% -command "Expand-Archive -Path eigen3.zip -DestinationPath AirLib\deps"
%powershell% -command "Move-Item -Path AirLib\deps\eigen* -Destination AirLib\deps\del_eigen"
REM move AirLib\deps\eigen* AirLib\deps\del_eigen
mkdir AirLib\deps\eigen3
move AirLib\deps\del_eigen\Eigen AirLib\deps\eigen3\Eigen
Expand Down

0 comments on commit bd925bc

Please sign in to comment.