idt/installers/
docker_langserver.rs

1use std::path::Path;
2
3use crate::Installer;
4
5pub struct DockerLangServer<'a> {
6    pub dev_tools_dir: &'a Path,
7    pub bin_dir: &'a Path,
8}
9
10impl Installer for DockerLangServer<'_> {
11    fn bin_name(&self) -> &'static str {
12        "docker-langserver"
13    }
14
15    fn install(&self) -> color_eyre::Result<()> {
16        let target_dir = crate::downloaders::npm::run(
17            self.dev_tools_dir,
18            "dockerfile-language-server-nodejs",
19            &["dockerfile-language-server-nodejs"],
20        )?;
21
22        let target = target_dir.join(self.bin_name());
23        ytil_sys::file::ln_sf(&target, &self.bin_dir.join(self.bin_name()))?;
24        ytil_sys::file::chmod_x(target)?;
25
26        Ok(())
27    }
28
29    // NOTE: skip because JS is a shitshow...
30    fn check_args(&self) -> Option<&[&str]> {
31        None
32    }
33}