mirror of
https://github.com/atuinsh/atuin.git
synced 2024-12-26 17:09:14 +01:00
Never use HISTFILE for fish shell import (#573)
This commit is contained in:
parent
540aa79054
commit
17c2e73388
@ -8,7 +8,7 @@ use chrono::{prelude::*, Utc};
|
|||||||
use directories::BaseDirs;
|
use directories::BaseDirs;
|
||||||
use eyre::{eyre, Result};
|
use eyre::{eyre, Result};
|
||||||
|
|
||||||
use super::{get_histpath, unix_byte_lines, Importer, Loader};
|
use super::{unix_byte_lines, Importer, Loader};
|
||||||
use crate::history::History;
|
use crate::history::History;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -36,7 +36,7 @@ fn default_histpath() -> Result<PathBuf> {
|
|||||||
if histpath.exists() {
|
if histpath.exists() {
|
||||||
Ok(histpath)
|
Ok(histpath)
|
||||||
} else {
|
} else {
|
||||||
Err(eyre!("Could not find history file. Try setting $HISTFILE"))
|
Err(eyre!("Could not find history file."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,8 +46,7 @@ impl Importer for Fish {
|
|||||||
|
|
||||||
async fn new() -> Result<Self> {
|
async fn new() -> Result<Self> {
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
let path = get_histpath(default_histpath)?;
|
let mut f = File::open(default_histpath()?)?;
|
||||||
let mut f = File::open(path)?;
|
|
||||||
f.read_to_end(&mut bytes)?;
|
f.read_to_end(&mut bytes)?;
|
||||||
Ok(Self { bytes })
|
Ok(Self { bytes })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user