Skip to content

Commit 35c9577

Browse files
committed
feat(libscoop): support use_sqlite_cache config
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
1 parent 17e474a commit 35c9577

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/libscoop/src/config.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ pub struct ConfigInner {
139139
#[serde(skip_serializing_if = "Option::is_none")]
140140
use_lessmsi: Option<bool>,
141141

142+
/// Use SQLite to cache manifests.
143+
///
144+
/// This config was introduced in Scoop v0.5.0 (Jul, 2024)
145+
#[serde(skip_serializing_if = "Option::is_none")]
146+
use_sqlite_cache: Option<bool>,
147+
142148
/// Disable `current` version junction creation.
143149
///
144150
/// The 'current' version alias will not be used. Shims and shortcuts will
@@ -333,6 +339,13 @@ impl Config {
333339
Err(_) => return Err(Error::ConfigValueInvalid(value.to_owned())),
334340
},
335341
},
342+
"use_sqlite_cache" => match is_unset {
343+
true => self.inner.use_sqlite_cache = None,
344+
false => match value.parse::<bool>() {
345+
Ok(value) => self.inner.use_sqlite_cache = Some(value),
346+
Err(_) => return Err(Error::ConfigValueInvalid(value.to_owned())),
347+
},
348+
},
336349
"proxy" => match value {
337350
"" | "none" => self.inner.proxy = None,
338351
_ => self.inner.proxy = Some(value.to_string()),
@@ -379,6 +392,7 @@ impl Default for Config {
379392
show_manifest: Default::default(),
380393
use_isolated_path: Default::default(),
381394
use_lessmsi: Default::default(),
395+
use_sqlite_cache: Default::default(),
382396
no_junction: Default::default(),
383397
private_hosts: Default::default(),
384398
proxy: Default::default(),

0 commit comments

Comments
 (0)