From 0ecdbec381012743ff8234ef7c4c8a1de61b70e8 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Mon, 26 Jun 2023 11:36:26 +0100 Subject: [PATCH] Abort datasync in pull mode if no dir --- ue-datasync.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ue-datasync.ps1 b/ue-datasync.ps1 index 6637f70..3a5d7c5 100644 --- a/ue-datasync.ps1 +++ b/ue-datasync.ps1 @@ -191,9 +191,16 @@ try { } } - # Create project sync dir if necessary + # Create project sync dir if necessary when pushing $syncdir = Join-Path $root $uprojname - New-Item -ItemType Directory $syncdir -Force > $null + if ($mode -eq "push") { + New-Item -ItemType Directory $syncdir -Force > $null + } elseif (-not (Test-Path $syncdir)) { + # Abort, no need to pull anything + Write-Output "No sync dir at $syncdir, aborting" + Exit 0 + } + Write-Output "Sync project folder: $syncdir" $umaps = Get-Current-Umaps