More progress and some debug logs to remove

This commit is contained in:
Conrad Irwin
2023-10-06 16:48:29 -06:00
parent 63a230f92e
commit f6bc229d1d
5 changed files with 46 additions and 6 deletions
+10
View File
@@ -66,6 +66,15 @@ use crate::open_url::{OpenListener, OpenRequest};
mod open_url;
fn main() {
writeln!(
OpenOptions::new()
.write(true)
.append(true)
.open("/Users/conrad/dbg")
.unwrap(),
"HELLO"
)
.unwrap();
let http = http::client();
init_paths();
init_logger();
@@ -270,6 +279,7 @@ fn main() {
}
OpenRequest::JoinChannel { channel_id } => cx
.update(|cx| {
dbg!("joining channel");
workspace::join_channel(channel_id, app_state.clone(), None, cx)
})
.detach(),
+13
View File
@@ -3,6 +3,8 @@ use cli::{ipc::IpcSender, CliRequest, CliResponse};
use futures::channel::mpsc;
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender};
use std::ffi::OsStr;
use std::fs::OpenOptions;
use std::io::Write;
use std::os::unix::prelude::OsStrExt;
use std::sync::atomic::Ordering;
use std::{path::PathBuf, sync::atomic::AtomicBool};
@@ -41,6 +43,16 @@ impl OpenListener {
}
pub fn open_urls(&self, urls: Vec<String>) {
writeln!(
OpenOptions::new()
.write(true)
.append(true)
.open("/Users/conrad/dbg")
.unwrap(),
"{:?}",
&urls,
)
.unwrap();
self.triggered.store(true, Ordering::Release);
let request = if let Some(server_name) =
urls.first().and_then(|url| url.strip_prefix("zed-cli://"))
@@ -79,6 +91,7 @@ impl OpenListener {
}
}
}
log::error!("invalid zed url: {}", request_path);
None
}