From 7e2e4d7b4a83b6fb8543aad547ffe65aafdcd21a Mon Sep 17 00:00:00 2001 From: Brian <18603393+brian6932@users.noreply.github.com> Date: Sat, 4 Jan 2025 08:27:48 -0500 Subject: [PATCH] bat: Persist configs (#6422) Co-authored-by: Hsiao-nan Cheung --- bucket/bat.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bucket/bat.json b/bucket/bat.json index 711b957344..0439ee5e9d 100644 --- a/bucket/bat.json +++ b/bucket/bat.json @@ -19,6 +19,25 @@ "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", "checkver": "github", "autoupdate": {