Skip to content
Snippets Groups Projects
Commit bd8dfa8e authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

clean_current_folder.m: update and document command

parent b76781fe
Branches 4.7
No related tags found
No related merge requests found
Pipeline #11090 failed
......@@ -22,6 +22,12 @@ Dynare misc commands
Puts the IRFs stored in ``oo_.irfs`` into vectors with the same name into the base workspace.
.. matcomm:: clean_current_folder ;
Cleans the current folder from all files generated by Dynare for the mod-files currently located in
the current folder. It will delete all class files (+folders), log-files, and folders generated by
previous runs of these files. Note that this also applies the results subfolder. Proceed with caution.
.. command:: prior_function(OPTIONS);
Executes a user-defined function on parameter draws from the prior
......
function clean_current_folder()
% Copyright © 2014-2017 Dynare Team
% Copyright © 2014-2024 Dynare Team
%
% This file is part of Dynare.
%
......@@ -22,20 +22,20 @@ a = dir('*.mod');
for i = 1:length(a)
[~,basename] = fileparts(a(i).name);
if exist([basename '.m'])
delete([basename '.m']);
end
if exist([basename '.log'])
if isfile([basename '.log'])
delete([basename '.log']);
end
if exist(basename,'dir')
if isfolder(basename)
rmdir(basename,'s');
end
if exist([basename '_steadystate.m'])
if isfolder(['+',basename])
[~,~]=rmdir(['+', basename],'s');
end
if isfile([basename '_steadystate.m'])
movefile([basename '_steadystate.m'],['protect_' basename '_steadystate.m']);
end
delete([basename '_*'])
if exist(['protect_' basename '_steadystate.m'])
if isfile(['protect_' basename '_steadystate.m'])
movefile(['protect_' basename '_steadystate.m'],[basename '_steadystate.m']);
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment