Better penumbra
This commit is contained in:
parent
1d93d7f34f
commit
e448140b21
|
@ -1,145 +0,0 @@
|
||||||
$ErrorActionPreference = 'SilentlyContinue'
|
|
||||||
|
|
||||||
$output = New-Object Collections.Generic.List[object]
|
|
||||||
$notInclude = @();
|
|
||||||
|
|
||||||
$counts = Get-Content "downloadcounts.json" | ConvertFrom-Json
|
|
||||||
$categoryFallbacksMap = Get-Content "categoryfallbacks.json" | ConvertFrom-Json
|
|
||||||
|
|
||||||
$dlTemplateInstall = "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/{0}/latest.zip"
|
|
||||||
$dlTemplateUpdate = "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/{0}/{1}/latest.zip"
|
|
||||||
|
|
||||||
$apiLevel = 4
|
|
||||||
|
|
||||||
$thisPath = Get-Location
|
|
||||||
|
|
||||||
$table = ""
|
|
||||||
|
|
||||||
Get-ChildItem -Path plugins -File -Recurse -Include *.json |
|
|
||||||
Foreach-Object {
|
|
||||||
$content = Get-Content $_.FullName | ConvertFrom-Json
|
|
||||||
|
|
||||||
if ($notInclude.Contains($content.InternalName)) {
|
|
||||||
$content | add-member -Force -Name "IsHide" -value "True" -MemberType NoteProperty
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$content | add-member -Force -Name "IsHide" -value "False" -MemberType NoteProperty
|
|
||||||
|
|
||||||
$newDesc = $content.Description -replace "\n", "<br>"
|
|
||||||
$newDesc = $newDesc -replace "\|", "I"
|
|
||||||
|
|
||||||
if ($content.DalamudApiLevel -eq $apiLevel) {
|
|
||||||
if ($content.RepoUrl) {
|
|
||||||
$table = $table + "| " + $content.Author + " | [" + $content.Name + "](" + $content.RepoUrl + ") | " + $newDesc + " |`n"
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$table = $table + "| " + $content.Author + " | " + $content.Name + " | " + $newDesc + " |`n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$testingPath = Join-Path $thisPath -ChildPath "testing" | Join-Path -ChildPath $content.InternalName | Join-Path -ChildPath $_.Name
|
|
||||||
if ($testingPath | Test-Path)
|
|
||||||
{
|
|
||||||
$testingContent = Get-Content $testingPath | ConvertFrom-Json
|
|
||||||
$content | add-member -Name "TestingAssemblyVersion" -value $testingContent.AssemblyVersion -MemberType NoteProperty
|
|
||||||
}
|
|
||||||
$content | add-member -Force -Name "IsTestingExclusive" -value "False" -MemberType NoteProperty
|
|
||||||
|
|
||||||
$dlCount = $counts | Select-Object -ExpandProperty $content.InternalName | Select-Object -ExpandProperty "count"
|
|
||||||
if ($dlCount -eq $null){
|
|
||||||
$dlCount = 0;
|
|
||||||
}
|
|
||||||
$content | add-member -Force -Name "DownloadCount" $dlCount -MemberType NoteProperty
|
|
||||||
|
|
||||||
if ($content.CategoryTags -eq $null) {
|
|
||||||
$content | Select-Object -Property * -ExcludeProperty CategoryTags
|
|
||||||
|
|
||||||
$fallbackCategoryTags = $categoryFallbacksMap | Select-Object -ExpandProperty $content.InternalName
|
|
||||||
if ($fallbackCategoryTags -ne $null) {
|
|
||||||
$content | add-member -Force -Name "CategoryTags" -value @() -MemberType NoteProperty
|
|
||||||
$content.CategoryTags += $fallbackCategoryTags
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$internalName = $content.InternalName
|
|
||||||
|
|
||||||
$updateDate = git log -1 --pretty="format:%ct" plugins/$internalName/latest.zip
|
|
||||||
if ($updateDate -eq $null){
|
|
||||||
$updateDate = 0;
|
|
||||||
}
|
|
||||||
$content | add-member -Force -Name "LastUpdate" $updateDate -MemberType NoteProperty
|
|
||||||
|
|
||||||
$installLink = $dlTemplateInstall -f $internalName, "False"
|
|
||||||
$content | add-member -Force -Name "DownloadLinkInstall" $installLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$installLink = $dlTemplateInstall -f $internalName, "True"
|
|
||||||
$content | add-member -Force -Name "DownloadLinkTesting" $installLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$updateLink = $dlTemplateUpdate -f "plugins", $internalName
|
|
||||||
$content | add-member -Force -Name "DownloadLinkUpdate" $updateLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$output.Add($content)
|
|
||||||
}
|
|
||||||
|
|
||||||
Get-ChildItem -Path testing -File -Recurse -Include *.json |
|
|
||||||
Foreach-Object {
|
|
||||||
$content = Get-Content $_.FullName | ConvertFrom-Json
|
|
||||||
|
|
||||||
if ($notInclude.Contains($content.InternalName)) {
|
|
||||||
$content | add-member -Force -Name "IsHide" -value "True" -MemberType NoteProperty
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$content | add-member -Force -Name "IsHide" -value "False" -MemberType NoteProperty
|
|
||||||
# $table = $table + "| " + $content.Author + " | " + $content.Name + " | " + $content.Description + " |`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
$dlCount = 0;
|
|
||||||
$content | add-member -Force -Name "DownloadCount" $dlCount -MemberType NoteProperty
|
|
||||||
|
|
||||||
if (($output | Where-Object {$_.InternalName -eq $content.InternalName}).Count -eq 0)
|
|
||||||
{
|
|
||||||
$content | add-member -Force -Name "TestingAssemblyVersion" -value $content.AssemblyVersion -MemberType NoteProperty
|
|
||||||
$content | add-member -Force -Name "IsTestingExclusive" -value "True" -MemberType NoteProperty
|
|
||||||
|
|
||||||
if ($content.CategoryTags -eq $null) {
|
|
||||||
$content | Select-Object -Property * -ExcludeProperty CategoryTags
|
|
||||||
|
|
||||||
$fallbackCategoryTags = $categoryFallbacksMap | Select-Object -ExpandProperty $content.InternalName
|
|
||||||
if ($fallbackCategoryTags -ne $null) {
|
|
||||||
$content | add-member -Force -Name "CategoryTags" -value @() -MemberType NoteProperty
|
|
||||||
$content.CategoryTags += $fallbackCategoryTags
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$internalName = $content.InternalName
|
|
||||||
|
|
||||||
$updateDate = git log -1 --pretty="format:%ct" testing/$internalName/latest.zip
|
|
||||||
if ($updateDate -eq $null){
|
|
||||||
$updateDate = 0;
|
|
||||||
}
|
|
||||||
$content | add-member -Force -Name "LastUpdate" $updateDate -MemberType NoteProperty
|
|
||||||
|
|
||||||
$installLink = $dlTemplateInstall -f $internalName, "True"
|
|
||||||
$content | add-member -Force -Name "DownloadLinkInstall" $installLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$installLink = $dlTemplateInstall -f $internalName, "True"
|
|
||||||
$content | add-member -Force -Name "DownloadLinkTesting" $installLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$updateLink = $dlTemplateUpdate -f "plugins", $internalName
|
|
||||||
$content | add-member -Force -Name "DownloadLinkUpdate" $updateLink -MemberType NoteProperty
|
|
||||||
|
|
||||||
$output.Add($content)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$outputStr = $output | ConvertTo-Json
|
|
||||||
Write-Output $outputStr
|
|
||||||
|
|
||||||
Out-File -FilePath .\pluginmaster.json -InputObject $outputStr
|
|
||||||
|
|
||||||
$template = Get-Content -Path mdtemplate.txt
|
|
||||||
$template = $template + $table
|
|
||||||
Out-File -FilePath .\plugins.md -InputObject $template
|
|
|
@ -73,7 +73,7 @@
|
||||||
"Author": "aRkker",
|
"Author": "aRkker",
|
||||||
"Name": "Penumbra-Modded",
|
"Name": "Penumbra-Modded",
|
||||||
"InternalName": "Penumbra",
|
"InternalName": "Penumbra",
|
||||||
"AssemblyVersion": "1.0.0.1",
|
"AssemblyVersion": "1.0.0.3",
|
||||||
"Description": "Runtime mod loader and manager, with aRkkers api tweaks lol",
|
"Description": "Runtime mod loader and manager, with aRkkers api tweaks lol",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||||
|
@ -84,6 +84,7 @@
|
||||||
"LoadPriority": 69420,
|
"LoadPriority": 69420,
|
||||||
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png",
|
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png",
|
||||||
"Punchline": "I added some API stuff lol",
|
"Punchline": "I added some API stuff lol",
|
||||||
|
"Changelog": "1.0.0.3\nBetter way of doing the mod enabling etc",
|
||||||
"LastUpdate": "1667431096",
|
"LastUpdate": "1667431096",
|
||||||
"IsHide": "False",
|
"IsHide": "False",
|
||||||
"DownloadCount": 69420,
|
"DownloadCount": 69420,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"Author": "aRkker",
|
"Author": "aRkker",
|
||||||
"Name": "Penumbra-Modded",
|
"Name": "Penumbra-Modded",
|
||||||
"InternalName": "Penumbra",
|
"InternalName": "Penumbra",
|
||||||
"AssemblyVersion": "1.0.0.1",
|
"AssemblyVersion": "1.0.0.3",
|
||||||
"Description": "Runtime mod loader and manager, with aRkkers api tweaks lol",
|
"Description": "Runtime mod loader and manager, with aRkkers api tweaks lol",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||||
|
@ -12,5 +12,6 @@
|
||||||
"DalamudApiLevel": 7,
|
"DalamudApiLevel": 7,
|
||||||
"LoadPriority": 69420,
|
"LoadPriority": 69420,
|
||||||
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png",
|
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png",
|
||||||
"Punchline": "I added some API stuff lol"
|
"Punchline": "I added some API stuff lol",
|
||||||
|
"Changelog": "1.0.0.3\nBetter way of doing the mod enabling etc"
|
||||||
}
|
}
|
Binary file not shown.
Loading…
Reference in New Issue