From c7b161e6b8e4b0c29261ba238d51f2b022f608bf Mon Sep 17 00:00:00 2001 From: Michael Krause Date: Fri, 8 May 2020 09:36:53 +0200 Subject: [PATCH] Fix: don't use fileread() directly in / In an MCR environment directly reading a file from / fails, work around that. --- Dockerfile | 2 +- spm_BIDS_App.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce42507..171adba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY run.sh spm_BIDS_App.m pipeline_participant.m pipeline_group.m /opt/spm${SPM RUN chmod +x /opt/spm${SPM_VERSION}/run.sh RUN chmod +x /opt/spm${SPM_VERSION}/spm${SPM_VERSION} RUN chmod +x /opt/spm${SPM_VERSION}/run_spm12.sh -COPY version /version +COPY version /opt/spm${SPM_VERSION}/version ENTRYPOINT ["/opt/spm12/run.sh"] #ENTRYPOINT ["/opt/spm12/spm12","script","/opt/spm12/spm_BIDS_App.m"] diff --git a/spm_BIDS_App.m b/spm_BIDS_App.m index 5db30b4..8219df8 100644 --- a/spm_BIDS_App.m +++ b/spm_BIDS_App.m @@ -35,7 +35,7 @@ case {'-v','--version'} fprintf('%s BIDS App, %s %s, version %s\n',... spm('version'), upper(spm_check_version), version, ... - deblank(fileread('/version'))); + deblank(fileread(fullfile(getenv('SPM_DIR'), 'version')))); case {'-h','--help'} fprintf([... 'Usage: bids/spm BIDS_DIR OUTPUT_DIR LEVEL [OPTIONS]\n',...