Skip to content

Commit

Permalink
[spec] Fix @python support bin for macOS 14
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffect42 committed Mar 4, 2024
1 parent 3238a90 commit 6a3c262
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/quote/pyquot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Describe 'quote/pyquot'


# Check if a Python interpreter is available
@python -c 'import sys; sys.exit(0)' && __have_python=1 || __have_python=0
{ @python -c 'import sys; sys.exit(0)' >/dev/null 2>&1; } \
&& __have_python=1 || __have_python=0
have_python() {
return $((! __have_python))
}
Expand Down
10 changes: 10 additions & 0 deletions spec/support/bin/@python
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#!/bin/sh -e
. "$SHELLSPEC_SUPPORT_BIN"
if ! command -v python >/dev/null 2>&1
then
if command -v python3 >/dev/null 2>&1
then
invoke python3 "$@"
elif command -v python2 >/dev/null 2>&1
then
invoke python2 "$@"
fi
fi
invoke python "$@"

0 comments on commit 6a3c262

Please sign in to comment.