| 250 | } |
| 251 | |
| 252 | std::filesystem::path PackageManager::uv_path() const { |
| 253 | static std::filesystem::path cached; |
| 254 | static bool searched = false; |
| 255 | |
| 256 | if (searched) |
| 257 | return cached; |
| 258 | searched = true; |
| 259 | |
| 260 | const auto exe_dir = get_executable_dir(); |
| 261 | bool bundled = false; |
| 262 | |
| 263 | if (const auto p = exe_dir / "bin" / UV_BINARY; std::filesystem::exists(p)) { |
| 264 | cached = p; |
| 265 | bundled = true; |
| 266 | } else if (const auto p = exe_dir / UV_BINARY; std::filesystem::exists(p)) { |
| 267 | cached = p; |
| 268 | bundled = true; |
| 269 | } |
| 270 | |
| 271 | if (cached.empty()) |
| 272 | LOG_WARN("Bundled uv not found"); |
| 273 | else if (bundled) |
| 274 | LOG_INFO("Using bundled uv: {}", lfs::core::path_to_utf8(cached)); |
| 275 | |
| 276 | return cached; |
| 277 | } |
| 278 | |
| 279 | bool PackageManager::is_uv_available() const { |
| 280 | return !uv_path().empty(); |
no test coverage detected