From e0120656413cb9f9a7887a57d3f2320c5f557969 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Thu, 1 Aug 2024 15:14:32 -0400 Subject: [PATCH] Remove basename --- workflow/apps/matlab/easy/EASYconsole.m | 9 +++++---- workflow/qhtcp-workflow | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/workflow/apps/matlab/easy/EASYconsole.m b/workflow/apps/matlab/easy/EASYconsole.m index 02ae0d55..9ce839a5 100644 --- a/workflow/apps/matlab/easy/EASYconsole.m +++ b/workflow/apps/matlab/easy/EASYconsole.m @@ -54,6 +54,7 @@ function varargout = EASYconsole(varargin) fprintf('Using EASY script directory: %s from hardcoded default\n', easyDir); end + whos % Set projectScansDir intelligently if ~isempty(getenv('PROJECT_SCANS_DIR')) @@ -107,7 +108,7 @@ function varargout = EASYconsole(varargin) end % Get the name of the project - projectName=basename(projectScansDir); + [~, projectName]=fileparts(projectScansDir); % Set the run-specific EASY output directory if ~isempty(getenv('EASY_RESULTS_DIR')) @@ -127,7 +128,7 @@ function varargout = EASYconsole(varargin) if ~isempty(getenv('EASY_PROJECT_NAME')) easyProjectName=getenv('EASY_PROJECT_NAME'); else - easyProjectName=basename(easyResultsDir); + [~, easyProjectName]=fileparts(easyResultsDir); end % User sanity check and warning @@ -284,7 +285,7 @@ function NewExpDat_Callback(~, ~, ~) [matfile,easyResultsDir]=uiputfile('.mat'); inputFileName=strrep(inputFile,'.mat',''); - projectName=basename(easyResultsDir); + [~, projectName]=fileparts(easyResultsDir); % Set paths matDir=fullfile(easyResultsDir,'matResults'); matFile=fullfile(matDir, projectName, '.mat'); @@ -355,7 +356,7 @@ function LoadDatFile_Callback(~, ~, ~) [matDir,matFile]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off'); load(matFile); easyResultsDir=fullfile(matDir,'..'); - projectName=basename(easyResultsDir); + [~, projectName]=fileparts(easyResultsDir); projectScansDir=fullfile(easyResultsDir, '..', '..', 'scans', projectName); % TODO this is pretty hacky and needs something more explicit diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 519a9837..3997aec3 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -296,6 +296,7 @@ print_header() { | | | | |_| | | || | | |_) | | |_| | _ | | || |___| __/ \__\_|_| |_| |_| \____|_| + EOF cat <<-EOF