diff --git a/bucket/aegisub.json b/bucket/aegisub.json index 99110f8c4fc07d..fe1baa5995f047 100644 --- a/bucket/aegisub.json +++ b/bucket/aegisub.json @@ -18,9 +18,11 @@ "extract_dir": "aegisub-portable", "pre_install": [ "# Hardlinks won't work properly here to persist files, because this app creates a new file instead of writing to the existing one.", - "'config.json' | ForEach-Object {", - " if (Test-Path -LiteralPath \"$persist_dir\\$_\" -PathType Leaf) {", - " Copy-Item -Path \"$persist_dir\\$_\" -Destination \"$dir\\$_\" -Force", + "if (Test-Path -LiteralPath \"$persist_dir\") {", + " Get-ChildItem -LiteralPath \"$persist_dir\" -File -Filter '*.json' | ForEach-Object {", + " if (Test-Path -LiteralPath \"$persist_dir\\$($_.Name)\" -PathType Leaf) {", + " Copy-Item -Path \"$persist_dir\\$($_.Name)\" -Destination \"$dir\\$($_.Name)\" -Force", + " }", " }", "}" ], @@ -47,10 +49,10 @@ ], "pre_uninstall": [ "# Hardlinks won't work properly here to persist files, because this app creates a new file instead of writing to the existing one.", - "'config.json' | ForEach-Object {", - " if (Test-Path -LiteralPath \"$dir\\$_\" -PathType Leaf) {", + "Get-ChildItem -LiteralPath \"$dir\" -File -Filter '*.json' | Where-Object { $_.Name -notin @('manifest.json', 'install.json') } | ForEach-Object {", + " if (Test-Path -LiteralPath \"$dir\\$($_.Name)\" -PathType Leaf) {", " ensure $persist_dir | Out-Null", - " Copy-Item -Path \"$dir\\$_\" -Destination \"$persist_dir\\$_\" -Force", + " Copy-Item -Path \"$dir\\$($_.Name)\" -Destination \"$persist_dir\\$($_.Name)\" -Force", " }", "}" ],