Skip to content

Commit

Permalink
Merge pull request #304 from scottaiton/fix_option
Browse files Browse the repository at this point in the history
Fix default run_directory option
  • Loading branch information
donnaaboise authored Jan 24, 2024
2 parents b97fa86 + 2d4078e commit d0049db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/fclaw2d_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ static char* old_path = NULL;
void fclaw2d_set_global_context(fclaw2d_global_t *glob)
{
fclaw_options_t* opts = fclaw2d_get_options(glob);
fclaw_set_logging_prefix(opts->logging_prefix);

// Change run directory
if(opts->run_directory != NULL){
if(strcmp(opts->run_directory,"") != 0){
FCLAW_ASSERT(old_path == NULL);
fclaw_set_logging_prefix(opts->logging_prefix);
old_path = fclaw_cwd();
fclaw_cd(opts->run_directory);
}
Expand Down
3 changes: 2 additions & 1 deletion src/fclaw_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ fclaw_register (fclaw_options_t* fclaw_opt, sc_options_t * opt)
{
sc_options_add_string (opt, 0, "run-directory",
&fclaw_opt->run_directory,
NULL, "Directory for running simulation in, can be relative for absolute [cwd]");
"", "Directory for running simulation in, can be relative for absolute. "
"Empty string means use current working directory []");

/* -------------------------- Time stepping control ------------------------------- */

Expand Down

0 comments on commit d0049db

Please sign in to comment.