Skip to content

Commit 7704cbc

Browse files
committed
refactor talkToMe
1 parent 7714739 commit 7704cbc

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/saveEventsFile.m

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@
128128
% close txt log file
129129
fclose(logFile(1).fileID);
130130

131-
talkToMe(cfg, logFile);
131+
message = sprintf('\nData were saved in this file:\n\n%s\n\n', ...
132+
fullfile( ...
133+
cfg.dir.outputSubject, ...
134+
cfg.fileName.modality, ...
135+
logFile.filename));
136+
talkToMe(cfg, message);
132137

133138
otherwise
134139

@@ -541,16 +546,8 @@ function warningSaveEventsFile(cfg, identifier, warningMessage)
541546
end
542547
end
543548

544-
function talkToMe(cfg, logFile)
545-
549+
function talkToMe(cfg, message)
546550
if cfg.verbose > 0
547-
548-
fprintf(1, '\nData were saved in this file:\n\n%s\n\n', ...
549-
fullfile( ...
550-
cfg.dir.outputSubject, ...
551-
cfg.fileName.modality, ...
552-
logFile.filename));
553-
551+
fprintf(1, message);
554552
end
555-
556553
end

0 commit comments

Comments
 (0)