Allow cli to accept --dev-server-token (#10944)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-04-24 13:15:19 -06:00 committed by GitHub
parent bd77232f65
commit 048fc7ad09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 4 deletions

View file

@ -26,6 +26,7 @@ project.workspace = true
fs.workspace = true
futures.workspace = true
settings.workspace = true
shellexpand.workspace = true
postage.workspace = true
[dev-dependencies]

View file

@ -180,7 +180,8 @@ impl DevServer {
_: Arc<Client>,
cx: AsyncAppContext,
) -> Result<proto::Ack> {
let path = std::path::Path::new(&envelope.payload.path);
let expanded = shellexpand::tilde(&envelope.payload.path).to_string();
let path = std::path::Path::new(&expanded);
let fs = cx.read_model(&this, |this, _| this.app_state.fs.clone())?;
let path_exists = fs.is_dir(path).await;
@ -232,9 +233,11 @@ impl DevServer {
(this.client.clone(), project)
})?;
let path = shellexpand::tilde(&remote_project.path).to_string();
project
.update(cx, |project, cx| {
project.find_or_create_local_worktree(&remote_project.path, true, cx)
project.find_or_create_local_worktree(&path, true, cx)
})?
.await?;