Skip to content

Commit 6842054

Browse files
committed
Update python global install to check for python python on macos
1 parent 8e586be commit 6842054

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

global/install/skm_global_install.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ else
135135
fi
136136

137137
# Get python3 directory for each OS if installed
138-
if [ "$HAS_PYTHON3" = true ]; then
138+
if [ "$HAS_PYTHON3" = true ] && [ "$(which python3)" = "/opt/homebrew/bin/python3" ]; then
139139
echo "Detecting python3 version to set global path.."
140140

141141
PYTHON_VERSION=`python3 -c 'import platform; major, minor, patch = platform.python_version_tuple(); print(major + "." + minor);'`
@@ -159,12 +159,13 @@ if [ "$HAS_PYTHON3" = true ]; then
159159
fi
160160

161161
# Copy splashkit python file to global location
162-
echo "Copying splashkit.py to "${PYTHON_LIB}""
163-
164-
$PRIVILEGED cp "${SKM_PATH}/python3/splashkit.py" "${PYTHON_LIB}"
165-
if [ ! $? -eq 0 ]; then
166-
echo "Failed to copy splashkit.py to ${PYTHON_LIB}"
167-
# exit 1
162+
if [ -d "$PYTHON_LIB" ]; then
163+
echo "Copying splashkit.py to "${PYTHON_LIB}""
164+
$PRIVILEGED cp "${SKM_PATH}/python3/splashkit.py" "${PYTHON_LIB}"
165+
if [ ! $? -eq 0 ]; then
166+
echo "Failed to copy splashkit.py to ${PYTHON_LIB}"
167+
exit 1
168+
fi
168169
fi
169170
fi
170171

0 commit comments

Comments
 (0)