bat: Persist configs (#6422)

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
This commit is contained in:
Brian 2025-01-04 08:27:48 -05:00 committed by GitHub
parent 458c85e82d
commit 7e2e4d7b4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,25 @@
"extract_dir": "bat-v0.24.0-i686-pc-windows-msvc" "extract_dir": "bat-v0.24.0-i686-pc-windows-msvc"
} }
}, },
"pre_install": [
"if (!(Test-Path \"$persist_dir\\config\")) {",
" Copy-Item -ErrorAction Ignore \"$env:APPDATA\\bat\\config\" \"$dir\\config\"",
" New-Item -ErrorAction Ignore \"$dir\\config\" | Out-Null",
"}",
"'syntaxes', 'themes' | ForEach-Object {",
" if (!(Test-Path \"$persist_dir\\$_\")) {",
" Copy-Item -ErrorAction Ignore -Recurse \"$env:APPDATA\\bat\\$_\" \"$dir\\$_\"",
" }",
"}"
],
"env_set": {
"BAT_CONFIG_DIR": "$dir"
},
"persist": [
"config",
"syntaxes",
"themes"
],
"bin": "bat.exe", "bin": "bat.exe",
"checkver": "github", "checkver": "github",
"autoupdate": { "autoupdate": {