-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove old 'time'. * cargo fmt --------- Co-authored-by: Adam Dossa <adam.dossa@gmail.com>
- Loading branch information
1 parent
6613d0d
commit de418e9
Showing
8 changed files
with
213 additions
and
349 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
use std::{env, path::PathBuf}; | ||
|
||
use vergen::{generate_cargo_keys, ConstantsFlags}; | ||
|
||
const ERROR_MSG: &str = "Failed to generate metadata files"; | ||
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; | ||
|
||
fn main() { | ||
generate_cargo_keys(ConstantsFlags::SHA_SHORT).expect(ERROR_MSG); | ||
|
||
let mut manifest_dir = PathBuf::from( | ||
env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), | ||
); | ||
|
||
while manifest_dir.parent().is_some() { | ||
if manifest_dir.join(".git/HEAD").exists() { | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
manifest_dir.join(".git/HEAD").display() | ||
); | ||
return; | ||
} | ||
|
||
manifest_dir.pop(); | ||
} | ||
generate_cargo_keys(); | ||
|
||
println!("cargo:warning=Could not find `.git/HEAD` from manifest dir!"); | ||
rerun_if_git_head_changed(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters