diff --git a/.ck-project-root b/.ck-project-root new file mode 100644 index 0000000000..a5ca7080df --- /dev/null +++ b/.ck-project-root @@ -0,0 +1,2 @@ +# Composable Kernel project root marker +# Used by scripts in script/tools/ to locate the project root diff --git a/script/tools/common.sh b/script/tools/common.sh index e5a39cea67..315fc535d0 100644 --- a/script/tools/common.sh +++ b/script/tools/common.sh @@ -5,7 +5,7 @@ # Common utilities for CK Docker tools # Shared configuration and helper functions -# Find project root (where .git directory is) +# Find project root using relative path (fallback) get_project_root() { local script_dir="$1" cd "${script_dir}/../.." && pwd @@ -149,11 +149,11 @@ is_build_configured() { [ -f "${build_dir}/build.ninja" ] } -# Find project root from any subdirectory (walks up to find .git) +# Find project root from any subdirectory (walks up to find .ck-project-root) find_project_root() { local dir="${1:-$(pwd)}" while [ "$dir" != "/" ]; do - if [ -d "$dir/.git" ]; then + if [ -f "$dir/.ck-project-root" ]; then echo "$dir" return 0 fi