Skip to content

Commit

Permalink
Install into a subdir of ~/.local/share/fish
Browse files Browse the repository at this point in the history
Otherwise you have all the gunk next to the history etc.

So we isolate it in ~/.local/share/fish/install/.
  • Loading branch information
faho committed May 7, 2024
1 parent 748353a commit 4ec25d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ fn setup_paths() {
rsconf::set_env_value("DATADIR", datadir.to_str().unwrap());
rsconf::rebuild_if_env_changed("DATADIR");

let datadir_subdir = if prefix_from_home {
"fish/install"
} else {
"fish"
};
rsconf::set_env_value("DATADIR_SUBDIR", datadir_subdir);

let bindir = get_path("BINDIR", "bin/", prefix.clone());
rsconf::set_env_value("BINDIR", bindir.to_str().unwrap());
rsconf::rebuild_if_env_changed("BINDIR");
Expand Down
3 changes: 2 additions & 1 deletion src/bin/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ use std::{env, ops::ControlFlow};

const DOC_DIR: &str = env!("DOCDIR");
const DATA_DIR: &str = env!("DATADIR");
const DATA_DIR_SUBDIR: &str = env!("DATADIR_SUBDIR");
const SYSCONF_DIR: &str = env!("SYSCONFDIR");
const BIN_DIR: &str = env!("BINDIR");

Expand Down Expand Up @@ -276,7 +277,7 @@ fn determine_config_directory_paths(argv0: impl AsRef<Path>) -> ConfigPaths {
// Fall back to what got compiled in.
FLOG!(config, "Using compiled in paths:");
paths = ConfigPaths {
data: PathBuf::from(DATA_DIR).join("fish"),
data: PathBuf::from(DATA_DIR).join(DATA_DIR_SUBDIR),
sysconf: PathBuf::from(SYSCONF_DIR).join("fish"),
doc: DOC_DIR.into(),
bin: BIN_DIR.into(),
Expand Down

0 comments on commit 4ec25d8

Please sign in to comment.