From f0fca3d7f34814a8a3cf5d3be3578f747ecda562 Mon Sep 17 00:00:00 2001 From: Benjamin Weinstein-Raun Date: Mon, 24 Mar 2025 04:00:16 -0700 Subject: fixes #1884: HISTFILE can be a directory or a file (#2630) Xonsh history import was failing (in the default xonsh configuration) because $HISTFILE is actually a directory in that case. This change sets up the xonsh import to check for a *directory* instead of a regular file, and makes it clearer that other importers expect a regular file. --- crates/atuin-client/src/import/xonsh_sqlite.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/atuin-client/src/import/xonsh_sqlite.rs') diff --git a/crates/atuin-client/src/import/xonsh_sqlite.rs b/crates/atuin-client/src/import/xonsh_sqlite.rs index 1b8d76fc..7d50ac84 100644 --- a/crates/atuin-client/src/import/xonsh_sqlite.rs +++ b/crates/atuin-client/src/import/xonsh_sqlite.rs @@ -10,7 +10,7 @@ use time::OffsetDateTime; use uuid::Uuid; use uuid::timestamp::{Timestamp, context::NoContext}; -use super::{Importer, Loader, get_histpath}; +use super::{Importer, Loader, get_histfile_path}; use crate::history::History; use crate::utils::get_host_user; @@ -93,7 +93,7 @@ impl Importer for XonshSqlite { async fn new() -> Result { // wrap xonsh-specific path resolver in general one so that it respects $HISTPATH let xonsh_data_dir = env::var("XONSH_DATA_DIR").ok(); - let db_path = get_histpath(|| xonsh_db_path(xonsh_data_dir))?; + let db_path = get_histfile_path(|| xonsh_db_path(xonsh_data_dir))?; let connection_str = db_path.to_str().ok_or_else(|| { eyre!( "Invalid path for SQLite database: {}", -- cgit v1.3.1