From a04f7c45e5f6e0d656d6e6a87d63ce2bcaa0865b Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Wed, 9 Mar 2016 18:56:15 +0100 Subject: Mock .git for packaging purposes --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 0cdab68..09a0e83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,11 +2,15 @@ extern crate ilc_cli; use ilc_cli::Cli; -static MASTER: &'static str = include_str!("../.git/refs/heads/master"); +static MASTER_HASH: &'static str = include_str!("../.git/refs/heads/master"); fn main() { ilc_cli::main(Cli { version: env!("CARGO_PKG_VERSION").into(), - master_hash: MASTER.trim_right().into(), + master_hash: if MASTER_HASH.is_empty() { + None + } else { + Some(MASTER_HASH.trim_right().to_owned()) + }, }); } -- cgit v1.2.3