Skip to content

Commit

Permalink
Merge pull request #49 from tesfa-ozem/macos-support
Browse files Browse the repository at this point in the history
[FIX] macos support
  • Loading branch information
Hussam-Suleiman authored May 29, 2024
2 parents 212ca45 + 78ee98c commit f1c8d1a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ else
/bin/echo "ERROR: You should define 'ODOO_VERSION' variable in "${ODOO_WORK_DIR}/.env-secret"."
exit 1
else
if [ "$(/bin/echo "${ODOO_VERSION}" | /bin/sed 's/^[0-9]\+'\.'[0-9]\+$//')" != '' ] ; then
if [ "$(/bin/echo "${ODOO_VERSION}" | /usr/bin/sed 's/^[0-9]\+'\.'[0-9]\+$//')" != '' ] ; then
/bin/echo "ERROR: 'ODOO_VERSION' does not a floating number!"
exit 1
else
Expand All @@ -100,7 +100,7 @@ if [ "${ODOO_VERSION}" = '' ] ; then
/bin/echo "ERROR: You should define 'ODOO_VERSION' variable in "${ODOO_WORK_DIR}/.env-secret""
exit 1
else
if [ "$(/bin/echo "${ODOO_VERSION}" | /bin/sed 's/^[0-9]\+'\.'[0-9]\+$//')" != '' ] ; then
if [ "$(/bin/echo "${ODOO_VERSION}" | /usr/bin/sed 's/^[0-9]\+'\.'[0-9]\+$//')" != '' ] ; then
/bin/echo "ERROR: 'ODOO_VERSION' does not a floating number!"
exit 1
fi
Expand Down Expand Up @@ -156,13 +156,17 @@ else
eval "$("${PYENV}" init -)"
"${PYENV}" install -s

PYVERSION="$(python -V 2>&1 | /bin/sed 's/^Python //; s/\.[0-9]*$//')"
PYVERSION="$(python -V 2>&1 | /usr/bin/sed 's/^Python //; s/\.[0-9]*$//')"
/bin/echo "Python version is ${PYVERSION}"

# Install virtualenv
VIRTUALENV="${PYENV_ROOT}/bin/virtualenv.pyz"
/bin/echo "INFO: Download ${VIRTUALENV}"
/usr/bin/wget --no-check-certificate "https://bootstrap.pypa.io/virtualenv/${PYVERSION}/virtualenv.pyz" -O "${VIRTUALENV}" || { /bin/echo 'Download of virtualenv package failed' ; exit 1; }
(/usr/bin/wget --no-check-certificate "https://bootstrap.pypa.io/virtualenv/${PYVERSION}/virtualenv.pyz" -O "${VIRTUALENV}" || \
(/bin/echo "INFO: /usr/bin/wget did not download virtualenv package, try /usr/bin/curl ..." && \
/usr/bin/curl -L "https://bootstrap.pypa.io/virtualenv/${PYVERSION}/virtualenv.pyz" -o "${VIRTUALENV}")) || \
{ /bin/echo 'ERROR: Download of virtualenv package failed!'; exit 1; }

/bin/echo "INFO: Build virtual environment in ${ODOO_WORK_DIR}/.venv"
python "${VIRTUALENV}" .venv || { /bin/echo 'Virtualenv creation failed' ; exit 1; }
fi
Expand Down

0 comments on commit f1c8d1a

Please sign in to comment.