Skip to content
Snippets Groups Projects
Commit faaec28c authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Create folder if the folder does not exist when creating new project.

Avoids crash of the GUI.
parent c5478872
No related branches found
No related tags found
No related merge requests found
function save_project() function save_project()
% function save_project()
% auxiliary function which saves project related data in the project (.dproj) file % auxiliary function which saves project related data in the project (.dproj) file
% %
% INPUTS % INPUTS
...@@ -11,7 +11,7 @@ function save_project() ...@@ -11,7 +11,7 @@ function save_project()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2015 Dynare Team % Copyright (C) 2003-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -31,6 +31,11 @@ function save_project() ...@@ -31,6 +31,11 @@ function save_project()
global project_info model_settings; global project_info model_settings;
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_; global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_;
if ~exist(project_info.project_folder)
warndlg(['Folder ' project_info.project_folder ' has been created.'], 'DynareGUI')
mkdir(project_info.project_folder)
end
fullFileName = [ project_info.project_folder, filesep, project_info.project_name,'.dproj']; fullFileName = [ project_info.project_folder, filesep, project_info.project_name,'.dproj'];
project_info.modified = 0; project_info.modified = 0;
save(fullFileName,'project_info'); save(fullFileName,'project_info');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment