mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 09:31:02 +00:00
--version commit hash - style improvement (#496)
* Update lib.rs * Update lib.rs * Update config.rs * Update lib.rs * Update lib.rs * tab correction
This commit is contained in:
committed by
Gav Wood
parent
5eb7b67c2a
commit
aa7d6f029f
@@ -163,9 +163,10 @@ where
|
|||||||
{
|
{
|
||||||
panic_hook::set();
|
panic_hook::set();
|
||||||
|
|
||||||
let full_version = service::Configuration::<<F>::Configuration, <F>::Genesis>
|
let full_version = service::config::full_version_from_strs(
|
||||||
::full_version_from_strs(version.version, version.commit);
|
version.version,
|
||||||
|
version.commit
|
||||||
|
);
|
||||||
let yaml = format!(include_str!("./cli.yml"),
|
let yaml = format!(include_str!("./cli.yml"),
|
||||||
name = version.executable_name,
|
name = version.executable_name,
|
||||||
description = version.description,
|
description = version.description,
|
||||||
|
|||||||
@@ -98,22 +98,9 @@ impl<C: Default, G: Serialize + DeserializeOwned + BuildStorage> Configuration<C
|
|||||||
configuration
|
configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns platform info
|
|
||||||
pub fn platform() -> String {
|
|
||||||
let env = Target::env();
|
|
||||||
let env_dash = if env.is_empty() { "" } else { "-" };
|
|
||||||
format!("{}-{}{}{}", Target::arch(), Target::os(), env_dash, env)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns full version string of this configuration.
|
/// Returns full version string of this configuration.
|
||||||
pub fn full_version(&self) -> String {
|
pub fn full_version(&self) -> String {
|
||||||
Self::full_version_from_strs(self.impl_version, self.impl_commit)
|
full_version_from_strs(self.impl_version, self.impl_commit)
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns full version string, using supplied version and commit.
|
|
||||||
pub fn full_version_from_strs(impl_version: &str, impl_commit: &str) -> String {
|
|
||||||
let commit_dash = if impl_commit.is_empty() { "" } else { "-" };
|
|
||||||
format!("{}{}{}-{}", impl_version, commit_dash, impl_commit, Self::platform())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Implementation id and version.
|
/// Implementation id and version.
|
||||||
@@ -121,3 +108,17 @@ impl<C: Default, G: Serialize + DeserializeOwned + BuildStorage> Configuration<C
|
|||||||
format!("{}/v{}", self.impl_name, self.full_version())
|
format!("{}/v{}", self.impl_name, self.full_version())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns platform info
|
||||||
|
pub fn platform() -> String {
|
||||||
|
let env = Target::env();
|
||||||
|
let env_dash = if env.is_empty() { "" } else { "-" };
|
||||||
|
format!("{}-{}{}{}", Target::arch(), Target::os(), env_dash, env)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns full version string, using supplied version and commit.
|
||||||
|
pub fn full_version_from_strs(impl_version: &str, impl_commit: &str) -> String {
|
||||||
|
let commit_dash = if impl_commit.is_empty() { "" } else { "-" };
|
||||||
|
format!("{}{}{}-{}", impl_version, commit_dash, impl_commit, platform())
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ extern crate serde_derive;
|
|||||||
|
|
||||||
mod components;
|
mod components;
|
||||||
mod error;
|
mod error;
|
||||||
mod config;
|
|
||||||
mod chain_spec;
|
mod chain_spec;
|
||||||
|
pub mod config;
|
||||||
pub mod chain_ops;
|
pub mod chain_ops;
|
||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|||||||
Reference in New Issue
Block a user