mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-27 09:20:03 +08:00
chore: version
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
/target/
|
/target/
|
||||||
|
.idea/
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|||||||
3
build.rs
3
build.rs
@@ -7,4 +7,7 @@ fn main() {
|
|||||||
let date_output = Command::new("date").args(&["+%Y-%m-%dT%H:%M:%S%z"]).output().unwrap();
|
let date_output = Command::new("date").args(&["+%Y-%m-%dT%H:%M:%S%z"]).output().unwrap();
|
||||||
let date = String::from_utf8(date_output.stdout).unwrap();
|
let date = String::from_utf8(date_output.stdout).unwrap();
|
||||||
println!("cargo:rustc-env=BUILD_DATE={}", date);
|
println!("cargo:rustc-env=BUILD_DATE={}", date);
|
||||||
|
let date_year_output = Command::new("date").args(&["+%Y"]).output().unwrap();
|
||||||
|
let date_year = String::from_utf8(date_year_output.stdout).unwrap();
|
||||||
|
println!("cargo:rustc-env=BUILD_YEAR={}", date_year)
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/misc.rs
16
src/misc.rs
@@ -1,5 +1,6 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use rust_util::util_env;
|
use rust_util::util_env;
|
||||||
|
use rust_util::util_term;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref VERBOSE: bool = util_env::is_env_on("BUILDJ_VERBOSE");
|
pub static ref VERBOSE: bool = util_env::is_env_on("BUILDJ_VERBOSE");
|
||||||
@@ -8,6 +9,7 @@ lazy_static! {
|
|||||||
pub static ref AUTH_TOKEN: Option<String> = env::var("BUILDJ_AUTH_TOKEN").ok();
|
pub static ref AUTH_TOKEN: Option<String> = env::var("BUILDJ_AUTH_TOKEN").ok();
|
||||||
pub static ref JAVA_VERSION: Option<String> = env::var("BUILDJ_JAVA").ok();
|
pub static ref JAVA_VERSION: Option<String> = env::var("BUILDJ_JAVA").ok();
|
||||||
pub static ref BUILDER_VERSION: Option<String> = env::var("BUILDJ_BUILDER").ok();
|
pub static ref BUILDER_VERSION: Option<String> = env::var("BUILDJ_BUILDER").ok();
|
||||||
|
pub static ref BUILD_YEAR: String = env::var("BUILD_YEAR").unwrap_or_else(|_| "unknown".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_usage() {
|
pub fn print_usage() {
|
||||||
@@ -16,9 +18,17 @@ pub fn print_usage() {
|
|||||||
|
|
||||||
pub fn print_version() {
|
pub fn print_version() {
|
||||||
println!(r#"buildj {} - {}
|
println!(r#"buildj {} - {}
|
||||||
Copyright (C) 2019-2020 Hatter Jiang.
|
Full git commit hash: {}{}{}
|
||||||
License MIT <https://opensource.org/licenses/MIT>
|
|
||||||
|
|
||||||
Written by Hatter Jiang"#, super::BUDERJ_VER, &super::GIT_HASH[0..7]);
|
Copyright (C) 2019-{} Hatter Jiang.
|
||||||
|
License MIT <{}https://opensource.org/licenses/MIT{}>
|
||||||
|
|
||||||
|
Official website: {}https://buildj.ruststack.org/{}
|
||||||
|
"#, super::BUDERJ_VER,
|
||||||
|
&super::GIT_HASH[0..7],
|
||||||
|
util_term::BOLD, &super::GIT_HASH, util_term::END,
|
||||||
|
*BUILD_YEAR,
|
||||||
|
util_term::UNDER, util_term::END,
|
||||||
|
util_term::UNDER, util_term::END);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user