feat: install si command from settings
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-29 21:37:42 +07:00
parent 9de81e31f4
commit df1f232aae
7 changed files with 242 additions and 20 deletions
+16
View File
@@ -73,6 +73,22 @@ pub fn documents_dir() -> PathBuf {
dirs::document_dir().unwrap_or_else(|| dirs::home_dir().unwrap_or_default())
}
/// The binary named `name` built next to the running executable, when it is there.
pub fn sibling_binary(name: &str) -> Option<PathBuf> {
let name = if std::env::consts::EXE_EXTENSION.is_empty() {
name.to_owned()
} else {
format!("{name}.{}", std::env::consts::EXE_EXTENSION)
};
let binary = std::env::current_exe().ok()?.with_file_name(name);
binary.is_file().then_some(binary)
}
/// Returns the user's binary folder, `~/.local/bin`, which most shells put on the PATH.
pub fn user_bin_dir() -> PathBuf {
home_dir().join(".local").join("bin")
}
fn config_dir() -> &'static Path {
CONFIG_DIR.as_path()
}