diff --git a/.gitignore b/.gitignore index 064e792..39eda51 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ extension.wasm # Added by cargo /target + +# Direnv +.envrc diff --git a/xtask-lsp-install/src/main.rs b/xtask-lsp-install/src/main.rs index ee174e8..3fbbb59 100644 --- a/xtask-lsp-install/src/main.rs +++ b/xtask-lsp-install/src/main.rs @@ -27,12 +27,10 @@ fn main() -> Result<(), Box> { eprintln!("Done"); - let from = Path::new("target/debug").join(LSP_BINARY); - let to = zed_paths::extensions_dir() - .join("work") - .join(EXTENSION_ID) - .join(LSP_BINARY); - let to = fs::canonicalize(to)?; + let target_dir = env::var("CARGO_TARGET_DIR").unwrap_or_else(|_| "target".to_string()); + let from = Path::new(&target_dir).join("debug").join(LSP_BINARY); + let to = zed_paths::extensions_dir().join("work").join(EXTENSION_ID); + let to = fs::canonicalize(to)?.join(LSP_BINARY); eprintln!( "Copying the LSP binary from {} to the extension working directory {}...",