mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
fix integrated cli check
This commit is contained in:
parent
4e9bdbd44f
commit
b987cb47f4
|
@ -312,7 +312,7 @@ stages:
|
|||
parameters:
|
||||
VSCODE_PUBLISH: ${{ variables.VSCODE_PUBLISH }}
|
||||
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
|
||||
VSCODE_BUILD_TUNNEL_CLI: true
|
||||
VSCODE_BUILD_TUNNEL_CLI: ${{ parameters.VSCODE_BUILD_TUNNEL_CLI }}
|
||||
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
VSCODE_RUN_SMOKE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
|
||||
|
|
|
@ -5,27 +5,25 @@
|
|||
|
||||
use std::{env, io};
|
||||
|
||||
use crate::constants::VSCODE_CLI_QUALITY;
|
||||
|
||||
/// Gets whether the current CLI seems like it's running in integrated mode,
|
||||
/// by looking at the location of the exe and known VS Code files.
|
||||
pub fn is_integrated_cli() -> io::Result<bool> {
|
||||
let exe = env::current_exe()?;
|
||||
let parent = match exe.parent().and_then(|p| p.parent()) {
|
||||
|
||||
let parent = match exe.parent() {
|
||||
Some(parent) if parent.file_name().and_then(|n| n.to_str()) == Some("bin") => parent,
|
||||
_ => return Ok(false),
|
||||
};
|
||||
|
||||
let parent = match parent.parent() {
|
||||
Some(p) => p,
|
||||
None => return Ok(false),
|
||||
};
|
||||
|
||||
let expected_file = if cfg!(windows) {
|
||||
match VSCODE_CLI_QUALITY {
|
||||
Some("insider") => "Code - Insiders.exe",
|
||||
Some("exploration") => "Code - Exploration.exe",
|
||||
_ => "Code.exe",
|
||||
}
|
||||
let expected_file = if cfg!(target_os = "darwin") {
|
||||
"node_modules.asar"
|
||||
} else {
|
||||
match VSCODE_CLI_QUALITY {
|
||||
Some("insider") => "code-insiders",
|
||||
Some("exploration") => "code-exploration",
|
||||
_ => "code",
|
||||
}
|
||||
"resources.pak"
|
||||
};
|
||||
|
||||
Ok(parent.join(expected_file).exists())
|
||||
|
|
Loading…
Reference in a new issue