Skip to content

Commit 8e27674

Browse files
committed
fluxdown: Simplify persist scripts
1 parent 2b9970c commit 8e27674

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

bucket/fluxdown.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,8 @@
3434
}
3535
},
3636
"pre_install": [
37-
"'flux_down.db', 'settings.json' | ForEach-Object {",
38-
" if (Test-Path \"$persist_dir\\$_\") {",
39-
" Copy-Item \"$persist_dir\\$_\" \"$dir\\$_\" -Force",
40-
" } else {",
41-
" if ($_ -eq 'flux_down.db') {",
42-
" New-Item -ItemType File \"$dir\\$_\" -Force | Out-Null",
43-
" } else {",
44-
" Set-Content \"$dir\\$_\" '{}' -Encoding UTF8",
45-
" }",
46-
" }",
47-
"}"
37+
"if (Test-Path \"$persist_dir\\flux_down.db\") { Copy-Item \"$persist_dir\\flux_down.db\" \"$dir\\flux_down.db\" -Force } else { New-Item -ItemType File \"$dir\\flux_down.db\" -Force | Out-Null }",
38+
"if (Test-Path \"$persist_dir\\settings.json\") { Copy-Item \"$persist_dir\\settings.json\" \"$dir\\settings.json\" -Force } else { Set-Content \"$dir\\settings.json\" '{}' -Encoding UTF8 }"
4839
],
4940
"shortcuts": [
5041
[
@@ -53,11 +44,8 @@
5344
]
5445
],
5546
"pre_uninstall": [
56-
"'flux_down.db', 'settings.json' | ForEach-Object {",
57-
" if (Test-Path \"$dir\\$_\") {",
58-
" Copy-Item \"$dir\\$_\" \"$persist_dir\\$_\" -Force",
59-
" }",
60-
"}"
47+
"if (Test-Path \"$dir\\flux_down.db\") { Copy-Item \"$dir\\flux_down.db\" \"$persist_dir\\flux_down.db\" -Force }",
48+
"if (Test-Path \"$dir\\settings.json\") { Copy-Item \"$dir\\settings.json\" \"$persist_dir\\settings.json\" -Force }"
6149
],
6250
"persist": [
6351
"bt_session",

0 commit comments

Comments
 (0)