use crate::teleport::types::Gate;
use pipelight_error::PipelightError;
use std::path::Path;
use miette::Result;
impl Gate {
pub fn file(&mut self, file_path: String) -> Result<Self, PipelightError> {
let path = Path::new(&file_path);
self.file_path = Some(path.display().to_string());
self.directory_path = Some(path.parent().unwrap().display().to_string());
Ok(self.to_owned())
}
pub fn directory(&mut self, file_path: String) -> Result<Self, PipelightError> {
let path = Path::new(&file_path);
self.directory_path = Some(path.display().to_string());
Ok(self.to_owned())
}
}