From fc777e91fffb0c305766ab8d2c8ec1422b51a9b1 Mon Sep 17 00:00:00 2001 From: Wytamma Wirth Date: Wed, 31 Jan 2024 16:26:05 +1100 Subject: [PATCH] :art: resolve local workflow path before installation --- snk/nest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snk/nest.py b/snk/nest.py index 739f2e3..b2bc6c2 100644 --- a/snk/nest.py +++ b/snk/nest.py @@ -136,14 +136,14 @@ def handle_force_installation(name: str): handle_force_installation(name) workflow_path = self.download(workflow, name, tag_name=tag, commit=commit) except InvalidWorkflowRepositoryError: - workflow_local_path = Path(workflow) + workflow_local_path = Path(workflow).resolve() if workflow_local_path.is_file(): raise InvalidWorkflowError( f"When installing a local workflow, the path must be a directory. Found: {workflow_local_path}" ) - if self.snk_workflows_dir.resolve().is_relative_to(workflow_local_path.resolve()) and not editable: + if self.snk_workflows_dir.resolve().is_relative_to(workflow_local_path) and not editable: raise InvalidWorkflowError( - f"The workflow directory contains SNK_HOME!\nWORKFLOW: {workflow_local_path.resolve()}\nSNK_HOME: {self.snk_workflows_dir.resolve()}.\n\nTry installing the workflow with --editable." + f"The workflow directory contains SNK_HOME!\nWORKFLOW: {workflow_local_path}\nSNK_HOME: {self.snk_workflows_dir.resolve()}.\n\nTry installing the workflow with --editable." ) if not name: name = workflow_local_path.name