Skip to content

Commit 3498403

Browse files
committed
update command check
1 parent 858b0a8 commit 3498403

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

publish/action.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,21 @@ runs:
4040
id: get_command
4141
shell: bash
4242
run: |
43-
# if `anaconda` command is available, use it directly; otherwise, check for `pixi` and install `anaconda-client` if needed
44-
if command -v anaconda &> /dev/null; then
45-
echo "'anaconda' command found. Using it for upload."
46-
echo "CMD=anaconda" >> $GITHUB_OUTPUT
43+
if command -v anaconda &>/dev/null; then
44+
echo "'anaconda' command is available. Using it for upload."
45+
export CMD="anaconda"
46+
elif pixi run anaconda --version &>/dev/null; then
47+
echo "anaconda command is available via pixi. Using 'pixi run anaconda' for upload."
48+
export CMD="pixi run anaconda"
4749
else
48-
if command -v pixi &> /dev/null; then
49-
echo "'pixi' command found. Installing anaconda-client via pixi..."
50-
pixi global install anaconda-client
51-
echo "CMD='pixi run anaconda'" >> $GITHUB_OUTPUT
52-
else
53-
echo "Error: Neither 'anaconda' nor 'pixi' command found. Please install the Anaconda Client or Pixi CLI to use this action."
54-
exit 1
55-
fi
50+
echo "anaconda command is not available via pixi. Checking for 'anaconda' command..."
51+
if command -v anaconda &>/dev/null; then
52+
echo "'anaconda' command found. Using it for upload."
53+
export CMD="anaconda"
54+
else
55+
echo "Neither 'anaconda' command nor 'pixi run anaconda' is available. Please ensure that anaconda-client is installed and available in PATH or via pixi."
56+
exit 1
57+
fi
5658
fi
5759
5860
- name: Upload package to Anaconda Cloud

0 commit comments

Comments
 (0)