Generate render link based on path to file.

This commit is contained in:
Tom Alexander
2025-02-08 18:59:45 -05:00
parent 3e952ef0f4
commit ff478253c3
4 changed files with 118 additions and 80 deletions

View File

@@ -1,3 +1,4 @@
use std::path::Path;
use std::path::PathBuf;
use crate::error::CustomError;
@@ -33,4 +34,13 @@ impl DependencyManager {
.expect("Popped more files off the dependency manager file stack than exist.");
Ok(())
}
pub(crate) fn get_current_folder(&self) -> Result<&Path, CustomError> {
Ok(self
.file_stack
.last()
.ok_or("No current file")?
.parent()
.ok_or("Current file was not in a directory")?)
}
}