Skip to content

Commit

Permalink
remove old dir
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Aug 5, 2022
1 parent 6438b4b commit 40dd40c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion betterncm/src/create_cert.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
use std::fs;

use crate::config::config_path_ca;
use crate::config::{config_path_ca, config_path};
use anyhow::{Result, Error};

pub fn create() -> Result<()> {
fs::create_dir_all(format!("{}/ca/", config_path_ca()))?;

if fs::try_exists(format!("{}/ca/", config_path()))?{
fs::remove_dir_all(format!("{}/ca/", config_path()));
}

let pkey_file_exists = fs::try_exists(format!("{}/ca/key.pem", config_path_ca()))?;
let ca_file_exists = fs::try_exists(format!("{}/ca/cert.crt", config_path_ca()))?;

Expand Down

0 comments on commit 40dd40c

Please sign in to comment.