Skip to content

Commit

Permalink
fix(build): AtlasVersionUndefined on release, presets
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Oct 6, 2024
1 parent 1c16bdb commit c129af1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
"type": "PowerShell",
"request": "launch",
"name": "Build Playbook (Release)",
"script": "& \"$(Join-Path '${workspaceFolder}' 'src/dependencies/local-build.ps1')\"",
"script": "& \"$(Join-Path '${workspaceFolder}' 'src/dependencies/local-build.ps1')\" -FileName 'Atlas Release'",
"cwd": "${workspaceFolder}/src/playbook",
"args": []
},
{
"type": "PowerShell",
"request": "launch",
"name": "Build Playbook (Release Candidate)",
"script": "& \"$(Join-Path '${workspaceFolder}' 'src/dependencies/local-build.ps1')\" -NoPassword -ReplaceOldPlaybook -Removals Verification",
"cwd": "${workspaceFolder}/src/playbook",
"args": []
}
Expand Down
9 changes: 5 additions & 4 deletions src/dependencies/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl
$tempOemYmlPath = Separator "$playbookTemp\$oemYmlPath"
if (Test-Path $oemYmlPath -PathType Leaf) {
$confXml = ([xml](Get-Content "playbook.conf" -Raw -EA 0)).Playbook
$version = "v$($confXml.Version)"
if ($version -like '*.*.*') {
if ($confXml.Version -match '^(0|[1-9]\d*)(\.(0|[1-9]\d*)){0,2}$') {
$version = "v$($confXml.Version)"

if ($confXml.Title | Select-String '(dev)' -Quiet) {
$version = $version + ' (dev)'
}
Expand All @@ -187,7 +188,7 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl
Set-Content -Path $tempOemYmlPath -Value $tempOemYml
}
} else {
Write-Error "Can't XML in 'playbook.conf', not setting OEM version."
Write-Error "Invalid version format in 'playbook.conf', not setting OEM version."
}
} else {
Write-Error "Can't find '$oemYmlPath', not setting OEM version."
Expand All @@ -207,7 +208,7 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl
if (!$NoPassword) { $pass = '-pmalte' }
& $7zPath a -spf -y -mx1 $pass -tzip "$apbxPath" `@"$files" | Out-Null
# add edited files
if (Test-Path $(Separator "$playbookTemp\*.*")) {
if (Test-Path $(Separator "$playbookTemp\*")) {
Push-Location "$playbookTemp"
& $7zPath u $pass "$apbxPath" * | Out-Null
Pop-Location
Expand Down

0 comments on commit c129af1

Please sign in to comment.