Minor tweaks to output
This commit is contained in:
@@ -14,7 +14,6 @@ pub(crate) fn write(
|
|||||||
config: &SideNodeConfig,
|
config: &SideNodeConfig,
|
||||||
file_path: &PathBuf,
|
file_path: &PathBuf,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
println!("Writing config to: {:?}", file_path);
|
|
||||||
let toml_string = to_string(config)?;
|
let toml_string = to_string(config)?;
|
||||||
let mut file = File::create(file_path)?;
|
let mut file = File::create(file_path)?;
|
||||||
file.write_all(toml_string.as_bytes())?;
|
file.write_all(toml_string.as_bytes())?;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ pub(crate) fn setup() -> String {
|
|||||||
|
|
||||||
/// Writes a PEM-encoded string to a file at key_path.
|
/// Writes a PEM-encoded string to a file at key_path.
|
||||||
pub(crate) fn write(key_path: PathBuf, pem: String) -> Result<(), std::io::Error> {
|
pub(crate) fn write(key_path: PathBuf, pem: String) -> Result<(), std::io::Error> {
|
||||||
println!("Writing key to: {:?}", key_path);
|
|
||||||
let mut file = File::create(key_path)?;
|
let mut file = File::create(key_path)?;
|
||||||
file.write(pem.to_string().as_bytes())?;
|
file.write(pem.to_string().as_bytes())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -12,10 +12,13 @@ pub(crate) fn init(home: PathBuf, config: SideNodeConfig) -> Result<(), std::io:
|
|||||||
ensure_side_directory_exists(&home)?;
|
ensure_side_directory_exists(&home)?;
|
||||||
let (key_path, config_path) = side_paths(home.clone());
|
let (key_path, config_path) = side_paths(home.clone());
|
||||||
|
|
||||||
|
println!("Writing key to: {:?}", key_path);
|
||||||
let pem = keys::setup();
|
let pem = keys::setup();
|
||||||
keys::write(key_path, pem)?;
|
keys::write(key_path, pem)?;
|
||||||
|
|
||||||
|
println!("Writing config to: {:?}", config_path);
|
||||||
config::write(&config, &config_path).expect("unable to write config file");
|
config::write(&config, &config_path).expect("unable to write config file");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user