-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdb.rs
86 lines (85 loc) · 3.38 KB
/
db.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
use crate::model::asset_name::AssetName;
use crate::model::tool::{ToolInfo, ToolInfoTag};
/// Get info about known tools from a hardcoded database
pub fn lookup_tool(tool_name: &str) -> Option<ToolInfo> {
match tool_name {
"bat" => Some(ToolInfo {
owner: "sharkdp".to_string(),
repo: "bat".to_string(),
exe_name: "bat".to_string(),
asset_name: AssetName {
linux: Some("x86_64-unknown-linux-musl".to_string()),
macos: Some("x86_64-apple-darwin".to_string()),
windows: Some("x86_64-pc-windows-msvc".to_string()),
},
tag: ToolInfoTag::Latest,
}),
"difftastic" => Some(ToolInfo {
owner: "Wilfred".to_string(),
repo: "difftastic".to_string(),
exe_name: "difft".to_string(),
asset_name: AssetName {
linux: Some("x86_64-unknown-linux-gnu".to_string()),
macos: Some("x86_64-apple-darwin".to_string()),
windows: Some("x86_64-pc-windows-msvc".to_string()),
},
tag: ToolInfoTag::Latest,
}),
"exa" => Some(ToolInfo {
owner: "ogham".to_string(),
repo: "exa".to_string(),
exe_name: "exa".to_string(),
asset_name: AssetName {
linux: Some("linux-x86_64-musl".to_string()),
macos: Some("macos-x86_64".to_string()),
windows: None,
},
tag: ToolInfoTag::Latest,
}),
"fd" => Some(ToolInfo {
owner: "sharkdp".to_string(),
repo: "fd".to_string(),
exe_name: "fd".to_string(),
asset_name: AssetName {
linux: Some("x86_64-unknown-linux-musl".to_string()),
macos: Some("x86_64-apple-darwin".to_string()),
windows: Some("x86_64-pc-windows-msvc".to_string()),
},
tag: ToolInfoTag::Latest,
}),
"ripgrep" => Some(ToolInfo {
owner: "BurntSushi".to_string(),
repo: "ripgrep".to_string(),
exe_name: "rg".to_string(),
asset_name: AssetName {
linux: Some("unknown-linux-musl".to_string()),
macos: Some("apple-darwin".to_string()),
windows: Some("x86_64-pc-windows-msvc".to_string()),
},
tag: ToolInfoTag::Latest,
}),
"tool-sync" => Some(ToolInfo {
owner: "chshersh".to_string(),
repo: "tool-sync".to_string(),
exe_name: "tool".to_string(),
asset_name: AssetName {
linux: Some("x86_64-unknown-linux-gnu".to_string()),
macos: Some("x86_64-apple-darwin".to_string()),
windows: Some("x86_64-pc-windows-msvc".to_string()),
},
tag: ToolInfoTag::Latest,
}),
// "tokei" => Some(ToolInfo {
// owner: "XAMPPRocky".to_string(),
// repo: "tokei".to_string(),
// exe_name: "tokei".to_string(),
// asset_name: AssetName {
// linux: Some("x86_64-unknown-linux-musl".to_string()),
// macos: Some("apple-darwin".to_string()),
// windows: Some("x86_64-pc-windows-msvc".to_string()),
// }
// tag: ToolInfoTag::Latest,
// }),
_ => None,
}
}