Skip to content

Commit 7cd01d4

Browse files
authored
notepad4: Fix persistence (#17289)
* Persist `Notepad4 DarkTheme.ini`. * Initialize config by copying default config to prevent incorrect folder creation. * Add workaround to handle incorrectly created config folders for existing users.
1 parent c335f28 commit 7cd01d4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

bucket/notepad4.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,23 @@
2828
"matepath"
2929
]
3030
],
31+
"pre_install": [
32+
"'Notepad4.ini', 'matepath.ini', 'Notepad4 DarkTheme.ini' | ForEach-Object {",
33+
" $persistPath = Join-Path $persist_dir $_",
34+
" $defaultPath = Join-Path $dir \"$_-default\"",
35+
" $targetPath = Join-Path $dir $_",
36+
" if (Test-Path -LiteralPath $persistPath -PathType Container) {",
37+
" Remove-Item -LiteralPath $persistPath -Recurse -Force",
38+
" }",
39+
" if (-not (Test-Path -LiteralPath $persistPath -PathType Leaf) -and (Test-Path -LiteralPath $defaultPath -PathType Leaf)) {",
40+
" Copy-Item -LiteralPath $defaultPath -Destination $targetPath",
41+
" }",
42+
"}"
43+
],
3144
"persist": [
3245
"Notepad4.ini",
33-
"matepath.ini"
46+
"matepath.ini",
47+
"Notepad4 DarkTheme.ini"
3448
],
3549
"checkver": {
3650
"github": "https://github.com/zufuliu/notepad2",

0 commit comments

Comments
 (0)