Skip to content

Commit

Permalink
make a copy before modifying conda env file (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener authored Feb 17, 2025
1 parent d40b660 commit 6c60a13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit 6c60a13

Please sign in to comment.