Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error on git not available #424

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub mod tasks;

use git_version::git_version;

const GIT_VERSION: &str = git_version!();
const GIT_VERSION: &str = git_version!(fallback = "unknown");

pub fn get_git_versin() -> &'static str {
pub fn get_git_version() -> &'static str {
GIT_VERSION
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn main() -> Result<(), ExitMessage> {
.try_init()
.map_err(|err| ExitMessage(format!("failed to initialize logger: {}", err)))?;

info!("Starting node with git version {}", fnn::get_git_versin());
info!("Starting node with git version {}", fnn::get_git_version());

let _span = info_span!("node", node = fnn::get_node_prefix()).entered();

Expand Down
2 changes: 1 addition & 1 deletion src/rpc/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ where
{
async fn node_info(&self) -> Result<NodeInfoResult, ErrorObjectOwned> {
let version = env!("CARGO_PKG_VERSION").to_string();
let commit_hash = crate::get_git_versin().to_string();
let commit_hash = crate::get_git_version().to_string();

let message =
|rpc_reply| NetworkActorMessage::Command(NetworkActorCommand::NodeInfo((), rpc_reply));
Expand Down
Loading