|
pub fn read_git_version () -> Option <String> {
|
|
use std::{
|
|
io::Read,
|
|
fs::File,
|
|
};
|
|
|
|
let mut buf = vec! [0u8; 512];
|
|
|
|
let mut f = File::open ("git_version.txt").ok ()?;
|
|
let bytes_read = f.read (&mut buf).ok ()?;
|
|
buf.truncate (bytes_read);
|
|
|
|
Some (String::from_utf8 (buf).ok ()?)
|
|
}
|