Get application version from git
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 7m26s
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 7m26s
This commit is contained in:
parent
28d62af5e6
commit
92f016bb82
23
Cargo.lock
generated
23
Cargo.lock
generated
|
@ -1057,6 +1057,26 @@ version = "0.28.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "git-version"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19"
|
||||||
|
dependencies = [
|
||||||
|
"git-version-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "git-version-macro"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "group"
|
name = "group"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
|
@ -3281,7 +3301,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tunnel_rs"
|
name = "tunnel_rs"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -3290,6 +3310,7 @@ dependencies = [
|
||||||
"crossterm 0.29.0",
|
"crossterm 0.29.0",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"futures",
|
"futures",
|
||||||
|
"git-version",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tunnel_rs"
|
name = "tunnel_rs"
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
default-run = "tunnel_rs"
|
default-run = "tunnel_rs"
|
||||||
|
|
||||||
|
@ -12,6 +11,7 @@ color-eyre = "0.6.3"
|
||||||
crossterm = "0.29.0"
|
crossterm = "0.29.0"
|
||||||
dotenvy = "0.15.7"
|
dotenvy = "0.15.7"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
|
git-version = "0.3.9"
|
||||||
http-body-util = { version = "0.1.3", features = ["full"] }
|
http-body-util = { version = "0.1.3", features = ["full"] }
|
||||||
hyper = { version = "1.6.0", features = ["full"] }
|
hyper = { version = "1.6.0", features = ["full"] }
|
||||||
hyper-util = { version = "0.1.11", features = ["full"] }
|
hyper-util = { version = "0.1.11", features = ["full"] }
|
||||||
|
|
|
@ -3,6 +3,7 @@ use std::io::Write;
|
||||||
use std::iter::once;
|
use std::iter::once;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use git_version::git_version;
|
||||||
use ratatui::layout::Rect;
|
use ratatui::layout::Rect;
|
||||||
use ratatui::prelude::CrosstermBackend;
|
use ratatui::prelude::CrosstermBackend;
|
||||||
use ratatui::{Terminal, TerminalOptions, Viewport};
|
use ratatui::{Terminal, TerminalOptions, Viewport};
|
||||||
|
@ -17,7 +18,7 @@ use crate::tunnel::{Registry, Tunnel, TunnelAccess};
|
||||||
|
|
||||||
/// Quickly create http tunnels for development
|
/// Quickly create http tunnels for development
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version = git_version!(), about, long_about = None)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// Make all tunnels public by default instead of private
|
/// Make all tunnels public by default instead of private
|
||||||
#[arg(long, group = "access")]
|
#[arg(long, group = "access")]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use std::cmp::{self, max};
|
use std::cmp::{self, max};
|
||||||
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
use git_version::git_version;
|
||||||
use ratatui::Frame;
|
use ratatui::Frame;
|
||||||
use ratatui::layout::{Constraint, Flex, Layout, Position, Rect};
|
use ratatui::layout::{Constraint, Flex, Layout, Position, Rect};
|
||||||
use ratatui::style::{Style, Stylize as _};
|
use ratatui::style::{Style, Stylize as _};
|
||||||
|
@ -131,12 +132,7 @@ impl Renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_title(&self, frame: &mut Frame, rect: Rect) {
|
pub fn render_title(&self, frame: &mut Frame, rect: Rect) {
|
||||||
let title = format!(
|
let title = format!("{} ({})", std::env!("CARGO_PKG_NAME"), git_version!()).bold();
|
||||||
"{} ({})",
|
|
||||||
std::env!("CARGO_PKG_NAME"),
|
|
||||||
std::env!("CARGO_PKG_VERSION")
|
|
||||||
)
|
|
||||||
.bold();
|
|
||||||
let title = Line::from(title).centered();
|
let title = Line::from(title).centered();
|
||||||
frame.render_widget(title, rect);
|
frame.render_widget(title, rect);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user