From 2a36b6a63691fcc79488fe6f3b1b8665b34d7af7 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Tue, 7 May 2024 10:54:41 +0100 Subject: [PATCH] Fix accidental overwriting of settings in LocalPreferences.toml --- machines/shared/add_dependencies_to_project.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/machines/shared/add_dependencies_to_project.jl b/machines/shared/add_dependencies_to_project.jl index 80a24ee13..008045e93 100644 --- a/machines/shared/add_dependencies_to_project.jl +++ b/machines/shared/add_dependencies_to_project.jl @@ -116,7 +116,11 @@ elseif Sys.isapple() global mk_preferences, local_preferences - # Just got the value for the setting, now write it to LocalPreferences.toml + # Just got the value for the setting, now write it to LocalPreferences.toml, + # but first reload the preferences from the LocalPreferences.toml file so that + # we don't overwrite the values that MPIPreferences has set. + local_preferences = TOML.parsefile(local_preferences_filename) + mk_preferences = local_preferences["moment_kinetics"] mk_preferences["mpi_library_path"] = mpi_library_path open(local_preferences_filename, "w") do io TOML.print(io, local_preferences, sorted=true)