mirror of
https://github.com/veeso/termscp.git
synced 2026-09-26 22:11:26 -07:00
issue 150: some issues with configuration (#151)
* issue 150: some issues with configuration
This commit is contained in:
@@ -25,12 +25,13 @@ pub fn init_config_dir() -> Result<Option<PathBuf>, String> {
|
||||
// Append termscp dir
|
||||
p.push("termscp/");
|
||||
// If directory doesn't exist, create it
|
||||
match p.exists() {
|
||||
true => Ok(Some(p)),
|
||||
false => match std::fs::create_dir(p.as_path()) {
|
||||
Ok(_) => Ok(Some(p)),
|
||||
Err(err) => Err(err.to_string()),
|
||||
},
|
||||
if p.exists() {
|
||||
return Ok(Some(p));
|
||||
}
|
||||
// directory doesn't exist; create dir recursively
|
||||
match std::fs::create_dir_all(p.as_path()) {
|
||||
Ok(_) => Ok(Some(p)),
|
||||
Err(err) => Err(err.to_string()),
|
||||
}
|
||||
} else {
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user