Rename repo_root to workspace_root

This seems like a slightly better term
because I think it also applies to tarball.
Ref: https://github.com/fish-shell/fish-shell/pull/11785#discussion_r2335280389
This commit is contained in:
Johannes Altmanninger
2025-09-13 10:18:32 +02:00
parent 33735f507a
commit 27db0e5fed
8 changed files with 21 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> PathBuf {
std::fs::canonicalize(path).unwrap()
}
pub fn get_repo_root() -> PathBuf {
pub fn workspace_root() -> PathBuf {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
canonicalize(manifest_dir.ancestors().nth(2).unwrap())
}
@@ -15,7 +15,7 @@ pub fn get_repo_root() -> PathBuf {
pub fn get_target_dir() -> PathBuf {
option_env!("CARGO_TARGET_DIR")
.map(canonicalize)
.unwrap_or(get_repo_root().join("target"))
.unwrap_or(workspace_root().join("target"))
}
// TODO Move this to rsconf

View File

@@ -17,19 +17,19 @@ fn main() {
fn build_man(man_dir: &Path) {
use std::{env, process::Command};
let repo_root_dir = fish_build_helper::get_repo_root();
let workspace_root = fish_build_helper::workspace_root();
let man_str = man_dir.to_str().unwrap();
let sec1_dir = man_dir.join("man1");
let sec1_str = sec1_dir.to_str().unwrap();
let docsrc_dir = repo_root_dir.join("doc_src");
let docsrc_dir = workspace_root.join("doc_src");
let docsrc_str = docsrc_dir.to_str().unwrap();
let sphinx_doc_sources = [
repo_root_dir.join("CHANGELOG.rst"),
repo_root_dir.join("CONTRIBUTING.rst"),
workspace_root.join("CHANGELOG.rst"),
workspace_root.join("CONTRIBUTING.rst"),
docsrc_dir.clone(),
];
fish_build_helper::rebuild_if_paths_changed(sphinx_doc_sources);