mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
fix issue where we would attempt to remove ssl directory regardless of whether or not we created it (#664)
This commit is contained in:
committed by
Aiden McClelland
parent
516db0a3ba
commit
c88bb11107
@@ -198,8 +198,20 @@ impl NginxControllerInner {
|
||||
let available_path =
|
||||
nginx_root.join(format!("sites-available/{}_{}.conf", package, id));
|
||||
let _ = futures::try_join!(
|
||||
tokio::fs::remove_dir_all(&package_path).map(|res| res
|
||||
.with_ctx(|_| (ErrorKind::Filesystem, package_path.display().to_string()))),
|
||||
async {
|
||||
if tokio::fs::metadata(&package_path).await.is_ok() {
|
||||
tokio::fs::remove_dir_all(&package_path)
|
||||
.map(|res| {
|
||||
res.with_ctx(|_| {
|
||||
(ErrorKind::Filesystem, package_path.display().to_string())
|
||||
})
|
||||
})
|
||||
.await?;
|
||||
Ok(())
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
tokio::fs::remove_file(&enabled_path).map(|res| res
|
||||
.with_ctx(|_| (ErrorKind::Filesystem, enabled_path.display().to_string()))),
|
||||
tokio::fs::remove_file(&available_path).map(|res| res.with_ctx(|_| (
|
||||
|
||||
Reference in New Issue
Block a user