Skip to content

Commit

Permalink
fix(local-build): check if playbook.conf modified
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Apr 4, 2024
1 parent b804f4e commit eecee55
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/playbook/local-build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ $defaultConfig.Keys | ForEach-Object {
if ($config.Keys -notcontains $_) {
$config = $config + @{
$_ = $defaultConfig.$_
}; $updateConfig = $true
}
$updateConfig = $true
}
}
if ($updateConfig) {CreateConfig $config}
Expand Down Expand Up @@ -188,8 +189,10 @@ try {
if ($removeWinverRequirement) {$patterns += "<string>", "</SupportedBuilds>", "<SupportedBuilds>"}
if ($removeProductCode) {$patterns += "<ProductCode>"}

$newContent = Get-Content "playbook.conf" | Where-Object { $_ -notmatch ($patterns -join '|') }
$newContent | Set-Content "$tempPlaybookConf" -Force
if ($patterns.Count -gt 0) {
$newContent = Get-Content "playbook.conf"| Where-Object { $_ -notmatch ($patterns -join '|') }
$newContent | Set-Content "$tempPlaybookConf" -Force
}

if ($removeDependencies -or $liveLog) {
$startYML = "$PWD\$ymlPath"
Expand Down Expand Up @@ -226,13 +229,12 @@ try {

$excludeFiles = @(
"local-build.cmd",
"playbook.conf",
"*.apbx"
); if (Test-Path $tempStartYML) { $excludeFiles += "custom.yml" }
)
if (Test-Path $tempStartYML) { $excludeFiles += "custom.yml" }
if (Test-Path $tempPlaybookConf) { $excludeFiles += "playbook.conf" }

# make playbook, 7z is faster
$filteredItems = @()

if (Test-Path $apbxPath) { Remove-Item $apbxFileName -Force }

(Get-ChildItem -File -Exclude $excludeFiles -Recurse).FullName `
Expand Down

0 comments on commit eecee55

Please sign in to comment.