search in ~/cppipe

This commit is contained in:
vrd
2025-06-06 18:00:38 +03:00
parent 184b211fc8
commit 96f29e01bb
+8 -2
View File
@@ -141,12 +141,18 @@ int parse_args_until_src(int argc, char* argv[])
fs::path find_path_to_src(string_view src_file) fs::path find_path_to_src(string_view src_file)
{ {
if(fs::exists(src_file)) // found relative to CWD if(fs::exists(src_file)) // Found relative to CWD
{ {
return src_file; return src_file;
} }
// search files on CPPIPEPATH // Search in ~/cppipe
if(fs::path p = fs::path(getenv("HOME")) / "cppipe" / src_file; fs::exists(p))
{
return p;
}
// Search files on CPPIPEPATH
const char* cppipepath_var = getenv("CPPIPEPATH"); const char* cppipepath_var = getenv("CPPIPEPATH");
if(cppipepath_var) // is set if(cppipepath_var) // is set
{ {