[platform] launcher: more robust product-info.json lookup (IJPL-172055)

(cherry picked from commit f02bc438b9e19d651a5a838c218431e566818895)

IJ-CR-163287

GitOrigin-RevId: 1fdf46341dcc79bdb48e859cde7b10aee8db33f0
This commit is contained in:
Roman Shevchenko
2025-05-16 19:46:03 +02:00
committed by intellij-monorepo-bot
parent 7e7f8e464a
commit 09bd560ea8

View File

@@ -412,7 +412,10 @@ fn find_ide_home(current_exe: &Path) -> Result<(PathBuf, PathBuf)> {
fn traverse_parents(mut candidate: PathBuf) -> Result<Option<(PathBuf, PathBuf)>> {
for _ in 0..IDE_HOME_LOOKUP_DEPTH {
candidate = candidate.parent_or_err()?;
candidate = match candidate.parent() {
Some(parent) => parent.to_path_buf(),
None => { break; }
};
debug!("Probing for IDE home: {:?}", candidate);
let product_info_path = candidate.join(PRODUCT_INFO_REL_PATH);
if product_info_path.is_file() {