Skip to content

Commit

Permalink
fix: resolve config_root for dir tasks option (#3649)
Browse files Browse the repository at this point in the history
  • Loading branch information
risu729 authored Dec 17, 2024
1 parent e84c9d1 commit ec9e03f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,11 @@ impl Task {

pub fn dir(&self) -> Result<Option<PathBuf>> {
let config = Config::get();
if let Some(dir) = &self.dir {
Ok(Some(PathBuf::from(dir)))
} else if let Some(dir) = self
.cf(&config)
.as_ref()
.and_then(|cf| cf.task_config().dir.clone())
{
if let Some(dir) = self.dir.clone().or_else(|| {
self.cf(&config)
.as_ref()
.and_then(|cf| cf.task_config().dir.clone())
}) {
let config_root = self.config_root.clone().unwrap_or_default();
let mut tera = get_tera(Some(&config_root));
let mut tera_ctx = config.tera_ctx.clone();
Expand Down

0 comments on commit ec9e03f

Please sign in to comment.