Merge branch 'main' into P11c
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s

This commit is contained in:
swaits committed 2026-10-29 17:27:00 -06:00
commit 30c998bb4e
4 files changed
+12 -10

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ impl Home {
} }
fn root(&self) -> PathBuf { fn root(&self) -> PathBuf {
self.dir.path().join(".local/share/wanderbooks") ledger_store::root::default_root(self.dir.path())
} }
fn book_dir(&self, book: &str) -> PathBuf { fn book_dir(&self, book: &str) -> PathBuf {
+1 -1
View File
@@ -32,7 +32,7 @@ impl Home {
} }
fn root(&self) -> PathBuf { fn root(&self) -> PathBuf {
self.dir.path().join(".local/share/wanderbooks") ledger_store::root::default_root(self.dir.path())
} }
fn cmd(&self, mode: &str, path: &Path) -> Command { fn cmd(&self, mode: &str, path: &Path) -> Command {
+1 -1
View File
@@ -61,7 +61,7 @@ impl Home {
} }
fn root(&self) -> PathBuf { fn root(&self) -> PathBuf {
self.dir.path().join(".local/share/wanderbooks") ledger_store::root::default_root(self.dir.path())
} }
fn book_dir(&self, id: &str) -> PathBuf { fn book_dir(&self, id: &str) -> PathBuf {
+9 -7
View File
@@ -19,7 +19,7 @@ fn setup_makes_the_private_folder_and_never_names_it() {
.prefix("wb-setup-") .prefix("wb-setup-")
.tempdir() .tempdir()
.unwrap(); .unwrap();
let root = home.path().join(".local/share/wanderbooks"); let root = ledger_store::root::default_root(home.path());
let out = wanderbooks() let out = wanderbooks()
.args(["setup", "--home"]) .args(["setup", "--home"])
.arg(home.path()) .arg(home.path())
@@ -91,8 +91,10 @@ fn a_root_elsewhere_is_noted_for_next_time() {
"{out:?}" "{out:?}"
); );
assert_eq!(mode(&elsewhere), 0o700); assert_eq!(mode(&elsewhere), 0o700);
let noted = let noted = std::fs::read_to_string(
std::fs::read_to_string(home.path().join(".local/share/wanderbooks.location")).unwrap(); ledger_store::root::platform_data_dir(home.path()).join("wanderbooks.location"),
)
.unwrap();
assert_eq!(noted.trim_end(), elsewhere.display().to_string()); assert_eq!(noted.trim_end(), elsewhere.display().to_string());
} }
@@ -142,8 +144,8 @@ fn another_home_ignores_this_accounts_data_home() {
.unwrap(); .unwrap();
assert!(out.status.success(), "{out:?}"); assert!(out.status.success(), "{out:?}");
assert!( assert!(
home.path() ledger_store::root::default_root(home.path())
.join(".local/share/wanderbooks/.wanderbooks-root") .join(".wanderbooks-root")
.is_file() .is_file()
); );
assert_eq!( assert_eq!(
@@ -242,7 +244,7 @@ fn setup_at_a_terminal_sets_the_owner_passphrase() {
assert!(shown.contains("The owner passphrase is set."), "{shown}"); assert!(shown.contains("The owner passphrase is set."), "{shown}");
assert!(!shown.contains(FIRST), "the passphrase was shown: {shown}"); assert!(!shown.contains(FIRST), "the passphrase was shown: {shown}");
assert!(!shown.contains(home.path().to_str().unwrap()), "{shown}"); assert!(!shown.contains(home.path().to_str().unwrap()), "{shown}");
let auth = home.path().join(".local/share/wanderbooks/auth"); let auth = ledger_store::root::default_root(home.path()).join("auth");
assert!(ledger_store::passphrase::verify(&auth, FIRST).unwrap()); assert!(ledger_store::passphrase::verify(&auth, FIRST).unwrap());
assert_eq!(mode(&auth), 0o700); assert_eq!(mode(&auth), 0o700);
assert_eq!(mode(&auth.join("owner.json")), 0o600); assert_eq!(mode(&auth.join("owner.json")), 0o600);
@@ -267,7 +269,7 @@ fn the_passphrase_is_typed_by_a_person_and_changed_only_with_the_one_in_force()
.unwrap(); .unwrap();
assert!(out.status.success(), "{out:?}"); assert!(out.status.success(), "{out:?}");
assert!(String::from_utf8_lossy(&out.stdout).contains("wanderbooks passphrase")); assert!(String::from_utf8_lossy(&out.stdout).contains("wanderbooks passphrase"));
let root = home.path().join(".local/share/wanderbooks"); let root = ledger_store::root::default_root(home.path());
let auth = root.join("auth"); let auth = root.join("auth");
assert!(!ledger_store::passphrase::is_set(&auth).unwrap()); assert!(!ledger_store::passphrase::is_set(&auth).unwrap());
let args = vec![ let args = vec![