idt/installers/
yaml_language_server.rs

1use std::path::Path;
2
3use crate::Installer;
4
5pub struct YamlLanguageServer<'a> {
6    pub dev_tools_dir: &'a Path,
7    pub bin_dir: &'a Path,
8}
9
10impl Installer for YamlLanguageServer<'_> {
11    fn bin_name(&self) -> &'static str {
12        "yaml-language-server"
13    }
14
15    fn install(&self) -> color_eyre::Result<()> {
16        let target_dir = crate::downloaders::npm::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
25    // NOTE: skip because JS is a shitshow...
26    fn check_args(&self) -> Option<&[&str]> {
27        None
28    }
29}