feat: impl forge_exists for publiccodeyml
This commit is contained in:
parent
0d0f5270fd
commit
8d222d185b
1 changed files with 11 additions and 0 deletions
|
@ -141,6 +141,17 @@ impl Federate for PccFederate {
|
||||||
self.rm_util(&path).await
|
self.rm_util(&path).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// check if a forge instance exists
|
||||||
|
async fn forge_exists(&self, hostname: &str) -> Result<bool, Self::Error> {
|
||||||
|
let path = self.get_instance_path(hostname, false).await?;
|
||||||
|
if path.exists() && path.is_dir() {
|
||||||
|
let instance = path.join(INSTANCE_INFO_FILE);
|
||||||
|
Ok(instance.exists() && instance.is_file())
|
||||||
|
} else {
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// create user isntance
|
/// create user isntance
|
||||||
async fn create_user(&self, f: &AddUser<'_>) -> Result<(), Self::Error> {
|
async fn create_user(&self, f: &AddUser<'_>) -> Result<(), Self::Error> {
|
||||||
let path = self.get_user_path(f.username, f.hostname, true).await?;
|
let path = self.get_user_path(f.username, f.hostname, true).await?;
|
||||||
|
|
Loading…
Reference in a new issue