Allow opening paths from the CLI

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Max Brunsfeld 2022-04-19 11:32:46 -07:00 committed by Antonio Scandurra
parent 05c44b9414
commit 43763fa2f8
4 changed files with 47 additions and 34 deletions

View file

@ -16,5 +16,6 @@ anyhow = "1.0"
core-foundation = "0.9"
core-services = "0.2"
clap = { version = "3.1", features = ["derive"] }
dirs = "3.0"
ipc-channel = "0.16"
serde = { version = "1.0", features = ["derive"] }

View file

@ -48,8 +48,10 @@ fn main() -> Result<()> {
}
fn locate_app() -> Result<PathBuf> {
Ok("/Users/nathan/src/zed/target/debug/bundle/osx/Zed.app".into())
// Ok("/Applications/Zed.app".into())
Ok(std::env::current_exe()?
.parent()
.unwrap()
.join("bundle/osx/Zed.app"))
}
fn launch_app(app_path: PathBuf) -> Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {