From 642b95e55efd7ee1001a432e135b7ce4f78f03ca Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Thu, 26 Sep 2024 15:47:57 -0600 Subject: [PATCH] minor fixes --- core/startos/src/disk/mount/util.rs | 18 +++++++++++------- core/startos/src/lxc/mod.rs | 3 ++- sdk/package/lib/test/makeOutput.ts | 2 +- sdk/package/lib/version/VersionGraph.ts | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/startos/src/disk/mount/util.rs b/core/startos/src/disk/mount/util.rs index 674f33304..61368e67a 100644 --- a/core/startos/src/disk/mount/util.rs +++ b/core/startos/src/disk/mount/util.rs @@ -5,6 +5,16 @@ use tracing::instrument; use crate::util::Invoke; use crate::Error; +pub async fn is_mountpoint(path: impl AsRef) -> Result { + let is_mountpoint = tokio::process::Command::new("mountpoint") + .arg(path.as_ref()) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .status() + .await?; + Ok(is_mountpoint.success()) +} + #[instrument(skip_all)] pub async fn bind, P1: AsRef>( src: P0, @@ -16,13 +26,7 @@ pub async fn bind, P1: AsRef>( src.as_ref().display(), dst.as_ref().display() ); - let is_mountpoint = tokio::process::Command::new("mountpoint") - .arg(dst.as_ref()) - .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) - .status() - .await?; - if is_mountpoint.success() { + if is_mountpoint(&dst).await? { unmount(dst.as_ref(), true).await?; } tokio::fs::create_dir_all(&src).await?; diff --git a/core/startos/src/lxc/mod.rs b/core/startos/src/lxc/mod.rs index ee08801df..3979263f0 100644 --- a/core/startos/src/lxc/mod.rs +++ b/core/startos/src/lxc/mod.rs @@ -126,7 +126,8 @@ impl LxcManager { Path::new(LXC_CONTAINER_DIR).join(container).join("rootfs"), true, ) - .await?; + .await + .log_err(); if tokio_stream::wrappers::ReadDirStream::new( tokio::fs::read_dir(&rootfs_path).await?, ) diff --git a/sdk/package/lib/test/makeOutput.ts b/sdk/package/lib/test/makeOutput.ts index 0597f96cc..434484be9 100644 --- a/sdk/package/lib/test/makeOutput.ts +++ b/sdk/package/lib/test/makeOutput.ts @@ -195,7 +195,7 @@ oldSpecToBuilder( default: true, }, avoidpartialspends: { - name: "avoid Partial Spends", + name: "Avoid Partial Spends", description: "Group outputs by address, selecting all or none, instead of selecting on a per-output basis. This improves privacy at the expense of higher transaction fees.", type: "boolean", diff --git a/sdk/package/lib/version/VersionGraph.ts b/sdk/package/lib/version/VersionGraph.ts index 0ebc0e6ea..91c7a0cc0 100644 --- a/sdk/package/lib/version/VersionGraph.ts +++ b/sdk/package/lib/version/VersionGraph.ts @@ -45,7 +45,7 @@ export class VersionGraph { VersionInfo, Vertex< ExtendedVersion | VersionRange, - (opts: { effects: T.Effects }) => Promise + (opts: { effects: T.Effects }) => Promise >, ] | undefined = undefined