MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / current_version

Method current_version

crates/paths/src/cli.rs:48–54  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

46 }
47
48 pub fn current_version(&self) -> anyhow::Result<Option<String>> {
49 match std::fs::read_link(self.current_version_dir()) {
50 Ok(path) => path.into_os_string().into_string().ok().context("not utf8").map(Some),
51 Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None),
52 Err(e) => Err(e.into()),
53 }
54 }
55
56 pub fn installed_versions(&self) -> anyhow::Result<Vec<String>> {
57 self.read_dir()?

Callers 2

execMethod · 0.80
execMethod · 0.80

Calls 7

current_version_dirMethod · 0.80
OkFunction · 0.50
ErrFunction · 0.50
mapMethod · 0.45
okMethod · 0.45
into_stringMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected