askpass: Fix cli path when executed in a remote server (#39475)
Closes #39469 Closes #39438 Closes #39458 I'm not able to test it, i would appreciate if somebody could do it. I think this bug was present also for SSH remote projects Release Notes: - Fixed an issue where zed bin was not found in remote servers for askpass --------- Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
This commit is contained in:
@@ -170,6 +170,13 @@ pub fn main() {
|
||||
|
||||
let args = Args::parse();
|
||||
|
||||
// `zed --askpass` Makes zed operate in nc/netcat mode for use with askpass
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
if let Some(socket) = &args.askpass {
|
||||
askpass::main(socket);
|
||||
return;
|
||||
}
|
||||
|
||||
// `zed --crash-handler` Makes zed operate in minidump crash handler mode
|
||||
if let Some(socket) = &args.crash_handler {
|
||||
crashes::crash_server(socket.as_path());
|
||||
@@ -212,6 +219,15 @@ pub fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
match util::get_zed_cli_path() {
|
||||
Ok(path) => askpass::set_askpass_program(path),
|
||||
Err(err) => {
|
||||
eprintln!("Error: {}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
let file_errors = init_paths();
|
||||
if !file_errors.is_empty() {
|
||||
files_not_created_on_launch(file_errors);
|
||||
@@ -1266,6 +1282,13 @@ struct Args {
|
||||
#[arg(hide = true)]
|
||||
dock_action: Option<usize>,
|
||||
|
||||
/// Used for SSH/Git password authentication, to remove the need for netcat as a dependency,
|
||||
/// by having Zed act like netcat communicating over a Unix socket.
|
||||
#[arg(long)]
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
#[arg(hide = true)]
|
||||
askpass: Option<String>,
|
||||
|
||||
#[arg(long, hide = true)]
|
||||
dump_all_actions: bool,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user