From 55a7e82b5db867e8add442cf339775cc4cf596ee Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 20 Sep 2020 13:47:25 +0100 Subject: [PATCH] Update last updated timestamps (#16) * Update last updated timestamps * Please our boy amis * add a comment for amis :( --- .../lib/BsdataGallery/BsdataGallery.psm1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/compile-index/lib/BsdataGallery/BsdataGallery.psm1 b/.github/actions/compile-index/lib/BsdataGallery/BsdataGallery.psm1 index 67f07dc4..77e303b9 100644 --- a/.github/actions/compile-index/lib/BsdataGallery/BsdataGallery.psm1 +++ b/.github/actions/compile-index/lib/BsdataGallery/BsdataGallery.psm1 @@ -19,9 +19,11 @@ function Get-BsdataGalleryCatpkg { battleScribeVersion = ($entries.cache.catpkg.properties.battleScribeVersion | Sort-Object -Bottom 1) -as [string] } + $GallerySettings.urls + @{ repositories = @($entries.cache | ForEach-Object { - $_.catpkg.properties.archived = $_.repo.archived -eq $true - return $_.catpkg.properties - }) + $_.catpkg.properties.archived = $_.repo.archived -eq $true + # temporary fix due to the BS app not supporting proper date formats :( + $_.catpkg.properties.lastUpdated = $_.catpkg.properties.lastUpdated.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff+0000") + return $_.catpkg.properties + }) } return $galleryJsonContent } @@ -67,7 +69,7 @@ function Get-GHApiUpdatedResult { [Parameter()] [int]$RetryIntervalSec = 5 ) - + # get object from API, but only if newer than what we've got already try { $apiArgs = @{ @@ -263,11 +265,11 @@ function Update-BsdataGalleryIndex { # Path to index entries directory [Parameter(Mandatory)] [string]$IndexPath, - + [Parameter(Mandatory)] [string]$Token ) - + # read registry entries $registry = [ordered]@{ } Get-ChildItem $RegistrationsPath *.catpkg.yml | Sort-Object Name | ForEach-Object { @@ -311,4 +313,4 @@ function Update-BsdataGalleryIndex { } } -Export-ModuleMember Update-BsdataGalleryIndex, Get-BsdataGalleryCatpkg \ No newline at end of file +Export-ModuleMember Update-BsdataGalleryIndex, Get-BsdataGalleryCatpkg