Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update last updated timestamps #16

Merged
merged 3 commits into from
Sep 20, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ 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
$_.catpkg.properties.lastUpdated = [datetime]::ParseExact($_.catpkg.properties.lastUpdated, 'MM/dd/yyyy HH:mm:ss', $null).ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff+0000")
Technoblazed marked this conversation as resolved.
Show resolved Hide resolved
return $_.catpkg.properties
})
}
return $galleryJsonContent
}
Expand Down Expand Up @@ -67,7 +68,7 @@ function Get-GHApiUpdatedResult {
[Parameter()]
[int]$RetryIntervalSec = 5
)

# get object from API, but only if newer than what we've got already
try {
$apiArgs = @{
Expand Down Expand Up @@ -260,11 +261,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 {
Expand Down Expand Up @@ -308,4 +309,4 @@ function Update-BsdataGalleryIndex {
}
}

Export-ModuleMember Update-BsdataGalleryIndex, Get-BsdataGalleryCatpkg
Export-ModuleMember Update-BsdataGalleryIndex, Get-BsdataGalleryCatpkg