Skip to content

Commit 9b9522d

Browse files
committed
Fix: update install_rmg.sh to conditionally apply strict channel priority flag
1 parent 453c8e2 commit 9b9522d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

devtools/install_rmg.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,18 @@ if [[ "$MODE" == "source" ]]; then
127127
exit 1
128128
fi
129129

130+
# Prepare flags - --strict-channel-priority only works with mamba/micromamba
131+
CHANNEL_PRIORITY_FLAG=""
132+
if [[ "$COMMAND_PKG" != "conda" ]]; then
133+
CHANNEL_PRIORITY_FLAG="--strict-channel-priority"
134+
fi
135+
130136
if $COMMAND_PKG env list | awk '{print $1}' | grep -qx "$ENV_NAME"; then
131137
echo ">>> Updating existing environment: $ENV_NAME"
132-
$COMMAND_PKG env update -n "$ENV_NAME" -f environment.yml --prune --strict-channel-priority
138+
$COMMAND_PKG env update -n "$ENV_NAME" -f environment.yml --prune $CHANNEL_PRIORITY_FLAG
133139
else
134140
echo ">>> Creating new environment: $ENV_NAME"
135-
$COMMAND_PKG env create -n "$ENV_NAME" -f environment.yml -y --strict-channel-priority
141+
$COMMAND_PKG env create -n "$ENV_NAME" -f environment.yml -y $CHANNEL_PRIORITY_FLAG
136142
fi
137143

138144
###############################################################################

0 commit comments

Comments
 (0)