Compare commits
5 Commits
cuddle-ple
...
27a4d2676d
| Author | SHA1 | Date | |
|---|---|---|---|
| 27a4d2676d | |||
|
43aac23453
|
|||
|
f90dc1e8d5
|
|||
| aef7b65e0c | |||
| 313b971c74 |
2210
Cargo.lock
generated
2210
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
# Git Now
|
# Git Now
|
||||||
|
|
||||||
|
> https://gitnow.kjuulh.io/
|
||||||
|
|
||||||
Git Now is a utility for easily navigating git projects from common upstream providers. Search, Download, and Enter projects as quickly as you can type.
|
Git Now is a utility for easily navigating git projects from common upstream providers. Search, Download, and Enter projects as quickly as you can type.
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gitnow"
|
name = "gitnow"
|
||||||
description = "Git Now is a utility for easily navigating git projects from common upstream providers. Search, Download, and Enter projects as quickly as you can type."
|
description = "Git Now is a utility for easily navigating git projects from common upstream providers. Search, Download, and Enter projects as quickly as you can type."
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
readme = "../../README.md"
|
readme = "../../README.md"
|
||||||
repository = "https://github.com/kjuulh/gitnow"
|
repository = "https://github.com/kjuulh/gitnow"
|
||||||
homepage = "https://gitnow-client.prod.kjuulh.app"
|
homepage = "https://gitnow-client.prod.kjuulh.app"
|
||||||
@@ -22,18 +22,18 @@ dotenvy.workspace = true
|
|||||||
serde = { version = "1.0.197", features = ["derive"] }
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
uuid = { version = "1.7.0", features = ["v4"] }
|
uuid = { version = "1.7.0", features = ["v4"] }
|
||||||
async-trait = "0.1.82"
|
async-trait = "0.1.82"
|
||||||
toml = "0.8.19"
|
toml = "0.9.0"
|
||||||
|
|
||||||
gitea-client = { version = "1.22.1" }
|
gitea-client = { version = "1.22.1" }
|
||||||
url = "2.5.2"
|
url = "2.5.2"
|
||||||
octocrab = "0.43.0"
|
octocrab = "0.49.0"
|
||||||
dirs = "6.0.0"
|
dirs = "6.0.0"
|
||||||
prost = "0.13.2"
|
prost = "0.13.2"
|
||||||
prost-types = "0.13.2"
|
prost-types = "0.13.2"
|
||||||
bytes = "1.7.1"
|
bytes = "1.7.1"
|
||||||
nucleo-matcher = "0.3.1"
|
nucleo-matcher = "0.3.1"
|
||||||
ratatui = { version = "0.29.0", features = ["termwiz"] }
|
ratatui = { version = "0.30.0", features = ["termwiz"] }
|
||||||
crossterm = { version = "0.28.0", features = ["event-stream"] }
|
crossterm = { version = "0.29.0", features = ["event-stream"] }
|
||||||
futures = "0.3.30"
|
futures = "0.3.30"
|
||||||
termwiz = "0.23.0"
|
termwiz = "0.23.0"
|
||||||
regex = "1.11.1"
|
regex = "1.11.1"
|
||||||
|
|||||||
@@ -3,18 +3,16 @@ use std::time::Duration;
|
|||||||
use crossterm::event::{EventStream, KeyCode};
|
use crossterm::event::{EventStream, KeyCode};
|
||||||
use futures::{FutureExt, StreamExt};
|
use futures::{FutureExt, StreamExt};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
crossterm,
|
TerminalOptions, Viewport, crossterm,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
widgets::{Block, Padding},
|
widgets::{Block, Padding},
|
||||||
TerminalOptions, Viewport,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::components::BatchCommand;
|
use crate::components::BatchCommand;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
create_dispatch,
|
Dispatch, IntoCommand, Msg, Receiver, create_dispatch,
|
||||||
spinner::{Spinner, SpinnerState},
|
spinner::{Spinner, SpinnerState},
|
||||||
Dispatch, IntoCommand, Msg, Receiver,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct InlineCommand {
|
pub struct InlineCommand {
|
||||||
@@ -120,7 +118,7 @@ impl InlineCommand {
|
|||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut cmd = self.update_state(&msg);
|
let mut cmd = self.update_state(msg);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let msg = cmd.into_command().execute(dispatch);
|
let msg = cmd.into_command().execute(dispatch);
|
||||||
@@ -128,7 +126,7 @@ impl InlineCommand {
|
|||||||
match msg {
|
match msg {
|
||||||
Some(Msg::Quit) => return Ok(true),
|
Some(Msg::Quit) => return Ok(true),
|
||||||
Some(msg) => {
|
Some(msg) => {
|
||||||
cmd = self.update_state(&msg);
|
cmd = self.update_state(msg);
|
||||||
}
|
}
|
||||||
None => break,
|
None => break,
|
||||||
}
|
}
|
||||||
@@ -163,7 +161,7 @@ impl InlineCommand {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_state(&mut self, msg: &Msg) -> impl IntoCommand {
|
fn update_state(&mut self, msg: Msg) -> impl IntoCommand {
|
||||||
tracing::debug!("handling message: {:?}", msg);
|
tracing::debug!("handling message: {:?}", msg);
|
||||||
|
|
||||||
let mut batch = BatchCommand::default();
|
let mut batch = BatchCommand::default();
|
||||||
@@ -178,7 +176,7 @@ impl InlineCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
batch.with(self.spinner.update(msg));
|
batch.with(self.spinner.update(&msg));
|
||||||
|
|
||||||
batch.into_command()
|
batch.into_command()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ impl CacheDuration {
|
|||||||
hours,
|
hours,
|
||||||
minutes,
|
minutes,
|
||||||
} => Some(
|
} => Some(
|
||||||
std::time::Duration::from_days(*days)
|
std::time::Duration::from_hours(*days * 24)
|
||||||
+ std::time::Duration::from_hours(*hours)
|
+ std::time::Duration::from_hours(*hours)
|
||||||
+ std::time::Duration::from_mins(*minutes),
|
+ std::time::Duration::from_mins(*minutes),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#![feature(duration_constructors)]
|
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
|||||||
Reference in New Issue
Block a user