Update Caveman Codex plugin integration
This commit is contained in:
@@ -785,11 +785,45 @@ function Sync-CodexPlugin {
|
||||
Copy-PathIfExists -Source $src -Destination $dst -Within $RepoRoot
|
||||
}
|
||||
Copy-CodexManifestDeclaredPaths -SourceRoot $sourcePath -PluginDir $pluginDir -Within $RepoRoot
|
||||
$materializePaths = @()
|
||||
if ($Source.PSObject.Properties.Name -contains "materializePaths" -and $Source.materializePaths) {
|
||||
$materializePaths = @($Source.materializePaths)
|
||||
}
|
||||
foreach ($materialize in $materializePaths) {
|
||||
$materializeSourceRelative = [string]$materialize.source
|
||||
$materializeDestinationRelative = [string]$materialize.destination
|
||||
Assert-RelativePathValue -Path $materializeSourceRelative
|
||||
Assert-RelativePathValue -Path $materializeDestinationRelative
|
||||
$materializeSource = Join-Path $ClonePath $materializeSourceRelative
|
||||
$materializeDestination = Join-Path $pluginDir $materializeDestinationRelative
|
||||
if (-not (Test-Path -LiteralPath $materializeSource)) {
|
||||
throw "materializePaths source does not exist: $materializeSource"
|
||||
}
|
||||
Remove-PathIfExists -Path $materializeDestination -Within $RepoRoot
|
||||
Copy-PathIfExists -Source $materializeSource -Destination $materializeDestination -Within $RepoRoot
|
||||
}
|
||||
Remove-ConfiguredExcludes -Root $pluginDir -ExcludePaths $Source.excludePaths -Within $RepoRoot
|
||||
Remove-ReadmeImageReferences -Root $pluginDir -ImagePathPrefixes $Source.readmeImageExcludes
|
||||
Remove-ReadmeLines -Root $pluginDir -LineExcludes $Source.readmeLineExcludes
|
||||
Compress-ImagesToWebp -Root $pluginDir -CompressPaths $Source.webpCompressPaths
|
||||
Apply-LocalOverrides -PluginDir $pluginDir -Source $Source
|
||||
if ($Source.PSObject.Properties.Name -contains "manifestVersionPath" -and $Source.manifestVersionPath) {
|
||||
$versionSourceRelative = [string]$Source.manifestVersionPath
|
||||
Assert-RelativePathValue -Path $versionSourceRelative
|
||||
$versionSourcePath = Join-Path $ClonePath $versionSourceRelative
|
||||
if (-not (Test-Path -LiteralPath $versionSourcePath -PathType Leaf)) {
|
||||
throw "manifestVersionPath does not exist: $versionSourcePath"
|
||||
}
|
||||
$versionMetadata = Read-JsonFile $versionSourcePath
|
||||
$version = [string]$versionMetadata.version
|
||||
if ($version -notmatch '^\d+\.\d+\.\d+([-.+][0-9A-Za-z.-]+)?$') {
|
||||
throw "manifestVersionPath does not contain a valid semver version: $versionSourcePath"
|
||||
}
|
||||
$outputManifestPath = Join-Path $pluginDir ".codex-plugin\plugin.json"
|
||||
$outputManifest = ConvertTo-Hashtable (Read-JsonFile $outputManifestPath)
|
||||
$outputManifest.version = $version
|
||||
Write-JsonFile -Path $outputManifestPath -Value $outputManifest
|
||||
}
|
||||
Write-Provenance -PluginDir $pluginDir -Source $Source -Commit $Commit -SyncedAt $SyncedAt -SourcePath $relativeSourcePath
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user