mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-24 05:41:14 -03:00
config_paths: remove vestiges of installable builds
Commit 3dc49d9d93 (Allow installable builds to be installed into a
specific path (#10923), 2024-12-22) added some ifdefs to use installed
config paths for installable builds that have already been installed.
The "installable" feature has been superseded by "embed-data"
which no longer uses config paths to retrieve files,
so remove those code paths. Further cleanup to follow.
This commit is contained in:
16
src/env/config_paths.rs
vendored
16
src/env/config_paths.rs
vendored
@@ -23,8 +23,10 @@
|
||||
};
|
||||
let argv0 = argv0.canonicalize().unwrap_or(argv0);
|
||||
let mut paths = ConfigPaths::default();
|
||||
#[allow(unused_mut)]
|
||||
let mut done = false;
|
||||
let exec_path = get_executable_path(&argv0);
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
if let Ok(exec_path) = exec_path.canonicalize() {
|
||||
FLOG!(
|
||||
config,
|
||||
@@ -54,22 +56,12 @@
|
||||
// The next check is that we are in a relocatable directory tree
|
||||
if exec_path.ends_with("bin/fish") {
|
||||
let base_path = exec_path.parent().unwrap().parent().unwrap();
|
||||
#[cfg(feature = "embed-data")]
|
||||
let data_dir = base_path.join("share/fish/install");
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
let data_dir = base_path.join("share/fish");
|
||||
let locale =
|
||||
(!cfg!(feature = "embed-data")).then(|| base_path.join("share/locale"));
|
||||
paths = ConfigPaths {
|
||||
// One obvious path is ~/.local (with fish in ~/.local/bin/).
|
||||
// If we picked ~/.local/share/fish as our data path,
|
||||
// we would install there and erase history.
|
||||
// So let's isolate us a bit more.
|
||||
data: Some(data_dir),
|
||||
data: Some(base_path.join("share/fish")),
|
||||
sysconf: base_path.join("etc/fish"),
|
||||
doc: base_path.join("share/doc/fish"),
|
||||
bin: Some(base_path.join("bin")),
|
||||
locale,
|
||||
locale: Some(base_path.join("share/locale")),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user