diff --git a/igf_airflow/utils/dag50_olink_reveal_nextflow_utils.py b/igf_airflow/utils/dag50_olink_reveal_nextflow_utils.py index 8f965cc9..d1d2f24c 100644 --- a/igf_airflow/utils/dag50_olink_reveal_nextflow_utils.py +++ b/igf_airflow/utils/dag50_olink_reveal_nextflow_utils.py @@ -156,6 +156,8 @@ def prepare_olink_nextflow_script( def run_olink_nextflow_script(run_script: str): try: bash_cmd = f"""set -eo pipefail; +cd { os.path.dirname(run_script) }; +chmod u+x { run_script }; bash { run_script }""" return bash_cmd except Exception as e: diff --git a/test/igf_airflow/test_dag50_olink_reveal_nextflow_utils.py b/test/igf_airflow/test_dag50_olink_reveal_nextflow_utils.py index f8dfdae7..113787fd 100644 --- a/test/igf_airflow/test_dag50_olink_reveal_nextflow_utils.py +++ b/test/igf_airflow/test_dag50_olink_reveal_nextflow_utils.py @@ -84,7 +84,7 @@ def test_run_olink_nextflow_script(self): analysis_cmd = run_olink_nextflow_script.function( script_file ) - assert analysis_cmd == f"set -eo pipefail;\nbash {script_file}" + assert analysis_cmd == f"set -eo pipefail;\ncd {os.path.dirname(script_file)};\nchmod u+x {script_file};\nbash {script_file}" if __name__=='__main__': unittest.main() \ No newline at end of file