/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45use std::{env, io};67/// Gets whether the current CLI seems like it's running in integrated mode,8/// by looking at the location of the exe and known VS Code files.9pub fn is_integrated_cli() -> io::Result<bool> {10let exe = env::current_exe()?;1112let parent = match exe.parent() {13Some(parent) if parent.file_name().and_then(|n| n.to_str()) == Some("bin") => parent,14_ => return Ok(false),15};1617let parent = match parent.parent() {18Some(p) => p,19None => return Ok(false),20};2122let expected_file = if cfg!(target_os = "macos") {23"node_modules.asar"24} else {25"resources.pak"26};2728Ok(parent.join(expected_file).exists())29}303132