cpclib_runner/runner/tracker/
chipnsfx.rs1use std::fmt::Display;
2use std::sync::OnceLock;
3
4use crate::delegated::{
5 DownloadableInformation, ExecutableInformation, InternetStaticCompiledApplication,
6 MutiplatformUrls, StaticInformation
7};
8
9pub const CHIPNSFX_CMD: &str = "chipnsfx";
10
11#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
12pub enum ChipnsfxVersion {
13 #[default]
14 V20241231
15}
16
17impl Display for ChipnsfxVersion {
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 let v = match self {
20 ChipnsfxVersion::V20241231 => "20241231"
21 };
22
23 write!(f, "{v}")
24 }
25}
26
27impl StaticInformation for ChipnsfxVersion {
28 fn static_download_urls(&self) -> &'static crate::delegated::MutiplatformUrls {
29 static URL: OnceLock<MutiplatformUrls> = OnceLock::new();
30
31 URL.get_or_init(|| {
32 MutiplatformUrls::builder()
33 .linux("http://cngsoft.no-ip.org/chipnsfx-20241231.zip")
34 .windows("http://cngsoft.no-ip.org/chipnsfx-20241231.zip")
35 .build()
36 })
37 }
38}
39
40impl DownloadableInformation for ChipnsfxVersion {
41 fn target_os_archive_format(&self) -> crate::delegated::ArchiveFormat {
42 crate::delegated::ArchiveFormat::Zip
43 }
44}
45
46impl ExecutableInformation for ChipnsfxVersion {
47 fn target_os_folder(&self) -> &'static str {
48 static FOLDER: OnceLock<String> = OnceLock::new();
49 FOLDER.get_or_init(|| format!("chipnsfx_{self}")).as_str()
50 }
51
52 fn target_os_exec_fname(&self) -> &'static str {
53 "CHIPNSFX.EXE"
54 }
55}
56
57impl InternetStaticCompiledApplication for ChipnsfxVersion {}