idt/installers/
ruff_lsp.rs1use std::path::Path;
2
3use crate::Installer;
4
5pub struct RuffLsp<'a> {
6 pub dev_tools_dir: &'a Path,
7 pub bin_dir: &'a Path,
8}
9
10impl Installer for RuffLsp<'_> {
11 fn bin_name(&self) -> &'static str {
12 "ruff-lsp"
13 }
14
15 fn install(&self) -> color_eyre::Result<()> {
16 let target_dir = crate::downloaders::pip::run(self.dev_tools_dir, self.bin_name(), &[self.bin_name()])?;
17
18 let target = target_dir.join(self.bin_name());
19 ytil_sys::file::ln_sf(&target, &self.bin_dir.join(self.bin_name()))?;
20 ytil_sys::file::chmod_x(target)?;
21
22 Ok(())
23 }
24}