get scripts path
(mut self)
| 59 | |
| 60 | /// get scripts path |
| 61 | pub fn scripts(mut self) -> Result<String> { |
| 62 | let root = &self.root()?; |
| 63 | if self.scripts.is_none() { |
| 64 | self.scripts = Some("scripts".into()); |
| 65 | } |
| 66 | |
| 67 | let p = PathBuf::from(root).join(self.scripts.ok_or(Error::NoneError)?); |
| 68 | if !PathBuf::from(&p).exists() { |
| 69 | std::fs::create_dir(&p)? |
| 70 | } |
| 71 | |
| 72 | Ok(p.to_string_lossy().to_string()) |
| 73 | } |
| 74 | } |