forked from arechen/EapilSkillMarket
Add DingTalk Workspace stable-release skills
This commit is contained in:
1 parent
1e95a722a7
commit
87dd53cf6d
284 files changed
+50342
No files matched your search
@@ -682,6 +682,21 @@ function Get-Clone {
|
||||
[object]$Source,
|
||||
[string]$CloneRoot
|
||||
)
|
||||
if ($Source.PSObject.Properties.Name -contains "releaseChannel" -and $Source.releaseChannel) {
|
||||
if ($Source.releaseChannel -ne "latest-stable" -or $Source.repo -notmatch '^https://github\.com/([\w-]+)/([\w.-]+?)(?:\.git)?$') {
|
||||
throw "releaseChannel requires latest-stable and a GitHub HTTPS repository"
|
||||
}
|
||||
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$($Matches[1])/$($Matches[2])/releases/latest" -Headers @{ Accept = "application/vnd.github+json"; "User-Agent" = "skill-market" } -TimeoutSec 30
|
||||
$tag = [string]$release.tag_name
|
||||
if ($release.draft -or $release.prerelease -or $tag -notmatch '^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$') {
|
||||
throw "Invalid stable release tag: $tag"
|
||||
}
|
||||
$Source | Add-Member -NotePropertyName ref -NotePropertyValue $tag -Force
|
||||
if (-not ($Source.PSObject.Properties.Name -contains "manifestOverrides") -or -not $Source.manifestOverrides) {
|
||||
$Source | Add-Member -NotePropertyName manifestOverrides -NotePropertyValue ([pscustomobject]@{}) -Force
|
||||
}
|
||||
$Source.manifestOverrides | Add-Member -NotePropertyName version -NotePropertyValue $tag.TrimStart('v') -Force
|
||||
}
|
||||
$clonePath = Join-Path $CloneRoot $Source.id
|
||||
Remove-PathIfExists -Path $clonePath -Within $CloneRoot
|
||||
$cloneArgs = @("clone", "--depth", "1")
|
||||
@@ -1016,6 +1031,18 @@ function Sync-SkillCollection {
|
||||
Remove-ReadmeLines -Root $pluginDir -LineExcludes $Source.readmeLineExcludes
|
||||
Compress-ImagesToWebp -Root $pluginDir -CompressPaths $Source.webpCompressPaths
|
||||
|
||||
if ($Source.PSObject.Properties.Name -contains "materializePaths" -and $Source.materializePaths) {
|
||||
foreach ($item in $Source.materializePaths) {
|
||||
Assert-RelativePathValue -Path $item.source
|
||||
Assert-RelativePathValue -Path $item.destination
|
||||
$src = Join-Path $ClonePath $item.source
|
||||
$dst = Join-Path $pluginDir $item.destination
|
||||
if (-not (Test-Path -LiteralPath $src)) { throw "materializePaths source does not exist: $src" }
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $dst -Parent) | Out-Null
|
||||
Remove-PathIfExists -Path $dst -Within $RepoRoot
|
||||
Copy-PathIfExists -Source $src -Destination $dst -Within $RepoRoot
|
||||
}
|
||||
}
|
||||
$metadata = @{}
|
||||
if ($Source.PSObject.Properties.Name -contains "metadata" -and $Source.metadata) {
|
||||
$metadata = ConvertTo-Hashtable $Source.metadata
|
||||
|
||||
Reference in new issue
Block a user