From 6c60a13e517fbf68882629962450de252e35540f Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Mon, 17 Feb 2025 10:07:26 -0600 Subject: [PATCH] make a copy before modifying conda env file (#180) --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index afb9e7c..e313249 100755 --- a/install.sh +++ b/install.sh @@ -177,6 +177,10 @@ echo "==== Create $env_name conda environment" [[ -z $conda_env_file ]] && conda_env_file="$mcsrc/conda-env.yml" +# Make a copy of the file since we might modify it +cp "$conda_env_file" "$conda_env_file".yml +conda_env_file=$conda_env_file.yml + if [[ -n $opt_py_ver ]]; then echo "=== Overriding Python version with $opt_py_ver" sed -i.bak "s,- python=3[0-9\.]*,- python=$opt_py_ver," "$conda_env_file" @@ -265,6 +269,9 @@ fi [[ $opt_modules -eq 1 ]] && ./makezip.sh +# Remove the temporary conda environment file +rm -f "$conda_env_file" + echo echo "===================================================================" echo "Mirgecom is now installed in $mcsrc."