- if self.project_dir is not None and (self.project_dir / '.env').is_file():
- self.project_dir = self.project_dir.resolve()
- self._config.update(dotenv_values(str(self.project_dir / '.env')))
+ if project_dir is not None:
+ self.project_dir: Optional[Path] = Path(project_dir).resolve()
+ if (self.project_dir / '.env').is_file():
+ self._config.update(dotenv_values(str(self.project_dir / '.env')))
+ else:
+ self.project_dir = None