Switch to strcmp

This commit is contained in:
2024-07-31 22:06:33 -04:00
parent 56ab318bf6
commit 0fe61b1db7

View File

@@ -98,18 +98,18 @@ function varargout = EASYconsole(varargin)
% User sanity check and warning % User sanity check and warning
if ~isempty(getenv('PROJECT_USER')) if ~isempty(getenv('PROJECT_USER'))
if ~equal(getenv('PROJECT_USER'), userName) if ~strcmp(getenv('PROJECT_USER'), userName)
disp("WARNING: PROJECT_USER does not match the current namespace"); disp("WARNING: PROJECT_USER does not match the current namespace");
end end
end end
% Allow module to override hardcoded default EASY directory % Allow module to override hardcoded default EASY directory
if ~isempty(getenv('EASY_DIR')) if ~isempty(getenv('EASY_DIR'))
EASY_DIR=fullfile(getenv('EASY_DIR')); ed=fullfile(getenv('EASY_DIR'));
if ~strcmp(easyDir, EASY_DIR) % sanity check if ~strcmp(easyDir, ed) % sanity check
disp("WARNING: EASY_DIR does not match this script's hardcoded EASY location"); disp("WARNING: EASY_DIR does not match this script's hardcoded EASY location");
disp("This is probably OK but if strange beahvior arises, we'll need to fix it in code"); disp("This is probably OK but this pathway is not well-tested");
easyDir=EASY_DIR; easyDir=ed;
end end
fprintf('Using EASY script directory: %s from environment variable EASY_DIR\n', easyDir); fprintf('Using EASY script directory: %s from environment variable EASY_DIR\n', easyDir);
else else