Updated to 4.0.0
This commit is contained in:
parent
b7554a5383
commit
938198bf11
234 changed files with 21069 additions and 12710 deletions
|
|
@ -1,8 +1,4 @@
|
|||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::{env, fs::File, io::Write, path::Path, process::Command};
|
||||
|
||||
fn get_git_version() -> Result<(u32, String), std::io::Error> {
|
||||
let output = Command::new("git")
|
||||
|
|
@ -14,8 +10,8 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
|
|||
let version_code: u32 = version_code
|
||||
.trim()
|
||||
.parse()
|
||||
.map_err(|_| std::io::Error::new(std::io::ErrorKind::Other, "Failed to parse git count"))?;
|
||||
let version_code = 10000 + 700 + version_code; // For historical reasons
|
||||
.map_err(|_| std::io::Error::other("Failed to parse git count"))?;
|
||||
let version_code = 40000 - 2815 + version_code; // For historical reasons
|
||||
|
||||
let version_name = String::from_utf8(
|
||||
Command::new("git")
|
||||
|
|
@ -23,7 +19,7 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
|
|||
.output()?
|
||||
.stdout,
|
||||
)
|
||||
.map_err(|_| std::io::Error::other("Failed to read git describe stdout"))?;
|
||||
.map_err(|_| std::io::Error::other("Failed to parse git count"))?;
|
||||
let version_name = version_name.trim_start_matches('v').to_string();
|
||||
Ok((version_code, version_name))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue