Skip to content

Commit

Permalink
move folder check into save script
Browse files Browse the repository at this point in the history
  • Loading branch information
RR-N committed Nov 26, 2024
1 parent 4acfc88 commit ed74856
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions +Program/+Helpers/save_and_open.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
function path = save_and_open(filename, input)

[path, ~, ~] = fileparts(filename);
if ~isfolder(path)
mkdir(path);
end

if isstruct(input)
save(filename, '-struct', 'input');

Expand Down
3 changes: 0 additions & 3 deletions +Program/+Routines/+Debug/graphics.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
end

if nargin > 0
if ~isfolder('debug')
mkdir('debug');
end
Program.Helpers.save_and_open(fullfile('debug', 'graphics_debug.mat'), debug_struct);
end
end
Expand Down
3 changes: 0 additions & 3 deletions +Program/+Routines/+Debug/rotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
debug_struct.graphics = Program.Routines.Debug.graphics();

if nargin > 0
if ~isfolder('debug')
mkdir('debug');
end
Program.Helpers.save_and_open(fullfile('debug', 'rotation_debug.mat'), debug_struct);
end
end
Expand Down

0 comments on commit ed74856

Please sign in to comment.