From 82c489e6d3d04f0f5ab943bd087d1e02106c5395 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Fri, 14 May 2021 16:13:56 +0100 Subject: [PATCH] Add data sync call to get latest --- doc/GetLatest.md | 3 +++ ue4-get-latest.ps1 | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/GetLatest.md b/doc/GetLatest.md index 7e67e37..e65d6b2 100644 --- a/doc/GetLatest.md +++ b/doc/GetLatest.md @@ -4,6 +4,9 @@ We've found it useful to provide a simple script which can be run on artists' machines to get the latest from Git, and make sure all the C++ components are built. +It now also automatically calls `ue4-datasync.ps1 pull` if `UE4SYNCROOT` is defined +in the environment. + While the UE editor can sometimes do this successfully on startup as well, it's just nicer to do it as part of the update process - the artist can then just double-click a shortcut on their desktop and let it run while getting diff --git a/ue4-get-latest.ps1 b/ue4-get-latest.ps1 index e4b1c1e..2a69b1f 100644 --- a/ue4-get-latest.ps1 +++ b/ue4-get-latest.ps1 @@ -114,20 +114,34 @@ try { } # Now build - $args = @() + $cmdargs = @() if ($nocloseeditor) { - $args += "-nocloseeditor" + $cmdargs += "-nocloseeditor" } if ($dryrun) { - $args += "-dryrun" + $cmdargs += "-dryrun" } # Use Invoke-Expression so we can use a string as options - Invoke-Expression "&'$PSScriptRoot/ue4-build.ps1' dev $args" + Invoke-Expression "&'$PSScriptRoot/ue4-build.ps1' dev $cmdargs" if ($LASTEXITCODE -ne 0) { throw "Build process failed, see above" } + # Automatically pull lighting builds, if environment variable defined + if ($Env:UE4SYNCROOT) { + $cmdargs = @() + if ($nocloseeditor) { + $cmdargs += "-nocloseeditor" + } + if ($dryrun) { + $cmdargs += "-dryrun" + } + # Use Invoke-Expression so we can use a string as options + Invoke-Expression "&'$PSScriptRoot/ue4-datasync.ps1' pull $cmdargs" + + } + Write-Output "-- Get Latest finished OK --"