修复了CreatAddon,更加聪明了
This commit is contained in:
parent
6791a31b95
commit
0751ee3ace
@ -1,3 +1,2 @@
|
||||
7z a -tzip SakuraDress.mcaddon sakura_dress_BP\ sakura_dress_RP\
|
||||
mkdir dist
|
||||
move SakuraDress.mcaddon dist\
|
||||
@pwsh update.ps1
|
||||
pause
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "SakuraDress",
|
||||
"description": "樱落绘境基岩版萌芽时装",
|
||||
"version": "1.2.5"
|
||||
"version": "0.1.2"
|
||||
}
|
@ -1,18 +1,30 @@
|
||||
{
|
||||
"format_version": 2,
|
||||
"header": {
|
||||
"name": "SakuraDress",
|
||||
"name": "SakuraDress 0.1.1",
|
||||
"description": "樱落绘境基岩版萌芽时装",
|
||||
"uuid": "898cbd07-3990-4787-a7d0-85c555cb9889",
|
||||
"version": [1, 2, 5],
|
||||
"min_engine_version": [1, 19, 0]
|
||||
"version": [
|
||||
0,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"min_engine_version": [
|
||||
1,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"description": "Made by fengyun",
|
||||
"type": "data",
|
||||
"uuid": "d8905ad9-229c-49a8-9c66-dac7adb249c0",
|
||||
"version": [1, 2, 5]
|
||||
"version": [
|
||||
0,
|
||||
1,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,18 +1,30 @@
|
||||
{
|
||||
"format_version": 2,
|
||||
"header": {
|
||||
"name": "SakuraDress",
|
||||
"name": "SakuraDress 0.1.1",
|
||||
"description": "樱落绘境基岩版萌芽时装",
|
||||
"uuid": "34a44803-a08e-431c-a074-613550dde7b8",
|
||||
"version": [1, 2, 5],
|
||||
"min_engine_version": [1, 19, 0]
|
||||
"version": [
|
||||
0,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"min_engine_version": [
|
||||
1,
|
||||
19,
|
||||
0
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"description": "Made by fengyun",
|
||||
"type": "resources",
|
||||
"uuid": "ff372316-7481-463b-8370-bcc342883c76",
|
||||
"version": [1, 2, 5]
|
||||
"version": [
|
||||
0,
|
||||
1,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
58
update.ps1
Normal file
58
update.ps1
Normal file
@ -0,0 +1,58 @@
|
||||
$intiFilePath = ".\init.json"
|
||||
|
||||
$intiContent = Get-Content $intiFilePath -Raw
|
||||
$intiObject = ConvertFrom-Json -InputObject $intiContent
|
||||
|
||||
$newName = $intiObject.name
|
||||
$versionParts = $intiObject.version.Split('.')
|
||||
$newVersion = [int[]]$versionParts
|
||||
$vers = $intiObject.version
|
||||
|
||||
#改这里
|
||||
$folders = @(".\sakura_dress_RP", ".\sakura_dress_BP")
|
||||
#改这里
|
||||
|
||||
$versionParts = $intiObject.version.Split('.')
|
||||
$major = [int]$versionParts[0]
|
||||
$minor = [int]$versionParts[1]
|
||||
$patch = [int]$versionParts[2]
|
||||
$patch++
|
||||
|
||||
foreach ($folder in $folders) {
|
||||
$manifestPath = Join-Path $folder "manifest.json"
|
||||
|
||||
$manifestContent = Get-Content $manifestPath -Raw
|
||||
$manifest = ConvertFrom-Json -InputObject $manifestContent
|
||||
|
||||
$manifest.header.name = "$newName $vers"
|
||||
$manifest.header.version = $newVersion
|
||||
if ($manifest.modules) {
|
||||
foreach ($module in $manifest.modules) {
|
||||
if ($module.PSobject.Properties.Name -contains "version") {
|
||||
$module.version = $newVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$jsonOutput = ConvertTo-Json $manifest -Depth 10
|
||||
$jsonOutput | Set-Content -Path $manifestPath -Encoding utf8NoBOM
|
||||
|
||||
Write-Host "Updated manifest.json in $folder" -ForegroundColor Green
|
||||
}
|
||||
|
||||
Write-Host "All manifest.json files have been updated." -ForegroundColor Green
|
||||
|
||||
|
||||
|
||||
#改这里
|
||||
7z a -tzip "SakuraDress v$vers.mcaddon" sakura_dress_BP\ sakura_dress_RP\
|
||||
mkdir dist
|
||||
#改这里
|
||||
move "SakuraDress v$vers.mcaddon" .\dist\
|
||||
|
||||
$newVersion = "$major.$minor.$patch"
|
||||
|
||||
$intiObject.version = $newVersion
|
||||
|
||||
$updatedIntiJson = ConvertTo-Json $intiObject -Depth 10
|
||||
$updatedIntiJson | Set-Content -Path $intiFilePath -Encoding utf8NoBOM
|
Loading…
x
Reference in New Issue
Block a user