mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
feat: Display build date to user, rather than current date
This commit is contained in:
parent
ee03823cff
commit
664efcde9d
|
@ -4,7 +4,6 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4.33"
|
|
||||||
clap = { version = "4.5.16", features = ["derive"] }
|
clap = { version = "4.5.16", features = ["derive"] }
|
||||||
crossterm = "0.27.0"
|
crossterm = "0.27.0"
|
||||||
ego-tree = "0.6.2"
|
ego-tree = "0.6.2"
|
||||||
|
@ -18,6 +17,9 @@ serde = { version = "1.0.205", features = ["derive"] }
|
||||||
toml = "0.8.19"
|
toml = "0.8.19"
|
||||||
which = "6.0.3"
|
which = "6.0.3"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
chrono = "0.4.33"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "linutil"
|
name = "linutil"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
5
build.rs
5
build.rs
|
@ -1,4 +1,9 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
// Rebuild program if any file in commands directory changes.
|
// Rebuild program if any file in commands directory changes.
|
||||||
println!("cargo:rerun-if-changed=src/commands");
|
println!("cargo:rerun-if-changed=src/commands");
|
||||||
|
// Add current date as a variable to be displayed in the 'Linux Toolbox' text.
|
||||||
|
println!(
|
||||||
|
"cargo:rustc-env=BUILD_DATE={}",
|
||||||
|
chrono::Local::now().format("%Y-%m-%d")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,10 +153,11 @@ impl AppState {
|
||||||
} else {
|
} else {
|
||||||
Style::new()
|
Style::new()
|
||||||
})
|
})
|
||||||
.block(Block::default().borders(Borders::ALL).title(format!(
|
.block(
|
||||||
"Linux Toolbox - {}",
|
Block::default()
|
||||||
chrono::Local::now().format("%Y-%m-%d")
|
.borders(Borders::ALL)
|
||||||
)))
|
.title(format!("Linux Toolbox - {}", env!("BUILD_DATE"))),
|
||||||
|
)
|
||||||
.scroll_padding(1);
|
.scroll_padding(1);
|
||||||
frame.render_stateful_widget(list, chunks[1], &mut self.selection);
|
frame.render_stateful_widget(list, chunks[1], &mut self.selection);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user