Remove basename

This commit is contained in:
2024-08-01 15:14:32 -04:00
parent 363f18abfb
commit e012065641
2 changed files with 6 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ function varargout = EASYconsole(varargin)
fprintf('Using EASY script directory: %s from hardcoded default\n', easyDir); fprintf('Using EASY script directory: %s from hardcoded default\n', easyDir);
end end
whos
% Set projectScansDir intelligently % Set projectScansDir intelligently
if ~isempty(getenv('PROJECT_SCANS_DIR')) if ~isempty(getenv('PROJECT_SCANS_DIR'))
@@ -107,7 +108,7 @@ function varargout = EASYconsole(varargin)
end end
% Get the name of the project % Get the name of the project
projectName=basename(projectScansDir); [~, projectName]=fileparts(projectScansDir);
% Set the run-specific EASY output directory % Set the run-specific EASY output directory
if ~isempty(getenv('EASY_RESULTS_DIR')) if ~isempty(getenv('EASY_RESULTS_DIR'))
@@ -127,7 +128,7 @@ function varargout = EASYconsole(varargin)
if ~isempty(getenv('EASY_PROJECT_NAME')) if ~isempty(getenv('EASY_PROJECT_NAME'))
easyProjectName=getenv('EASY_PROJECT_NAME'); easyProjectName=getenv('EASY_PROJECT_NAME');
else else
easyProjectName=basename(easyResultsDir); [~, easyProjectName]=fileparts(easyResultsDir);
end end
% User sanity check and warning % User sanity check and warning
@@ -284,7 +285,7 @@ function NewExpDat_Callback(~, ~, ~)
[matfile,easyResultsDir]=uiputfile('.mat'); [matfile,easyResultsDir]=uiputfile('.mat');
inputFileName=strrep(inputFile,'.mat',''); inputFileName=strrep(inputFile,'.mat','');
projectName=basename(easyResultsDir); [~, projectName]=fileparts(easyResultsDir);
% Set paths % Set paths
matDir=fullfile(easyResultsDir,'matResults'); matDir=fullfile(easyResultsDir,'matResults');
matFile=fullfile(matDir, projectName, '.mat'); 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'); [matDir,matFile]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off');
load(matFile); load(matFile);
easyResultsDir=fullfile(matDir,'..'); easyResultsDir=fullfile(matDir,'..');
projectName=basename(easyResultsDir); [~, projectName]=fileparts(easyResultsDir);
projectScansDir=fullfile(easyResultsDir, '..', '..', 'scans', projectName); projectScansDir=fullfile(easyResultsDir, '..', '..', 'scans', projectName);
% TODO this is pretty hacky and needs something more explicit % TODO this is pretty hacky and needs something more explicit

View File

@@ -296,6 +296,7 @@ print_header() {
| | | | |_| | | || | | |_) | | | | | |_| | | || | | |_) |
| |_| | _ | | || |___| __/ | |_| | _ | | || |___| __/
\__\_|_| |_| |_| \____|_| \__\_|_| |_| |_| \____|_|
EOF EOF
cat <<-EOF cat <<-EOF