mirror of
https://github.com/socatlolmeow/drift.git
synced 2026-11-03 19:27:19 +00:00
(cleanup): cleanup on src/
This commit is contained in:
parent
0fc9c0bb2c
commit
576801f108
10 changed files with 503 additions and 193 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -49,8 +49,14 @@ fn tool_version(name: &str) -> Option<String> {
|
|||
fn missing_dependencies(verbose: bool) -> Vec<String> {
|
||||
let mut missing = Vec::new();
|
||||
for (tool, hint) in [
|
||||
("mpv", "sudo apt install mpv | brew install mpv | sudo pacman -S mpv"),
|
||||
("yt-dlp", "pipx install yt-dlp | brew install yt-dlp | sudo pacman -S yt-dlp"),
|
||||
(
|
||||
"mpv",
|
||||
"sudo apt install mpv | brew install mpv | sudo pacman -S mpv",
|
||||
),
|
||||
(
|
||||
"yt-dlp",
|
||||
"pipx install yt-dlp | brew install yt-dlp | sudo pacman -S yt-dlp",
|
||||
),
|
||||
] {
|
||||
match tool_version(tool) {
|
||||
Some(v) => {
|
||||
|
|
@ -122,7 +128,7 @@ fn run(initial_query: Option<String>) -> Result<()> {
|
|||
app.run_command(&format!("search {q}"));
|
||||
}
|
||||
|
||||
let mut terminal = ratatui::init();
|
||||
let mut terminal = ratatui::try_init()?;
|
||||
let result = event_loop(&mut terminal, &mut app, &rx);
|
||||
ratatui::restore();
|
||||
app.shutdown();
|
||||
|
|
|
|||
Loading…
Reference in a new issue