Skip to content
Snippets Groups Projects
Commit 5fcec47c authored by François  LAURENT's avatar François LAURENT
Browse files

Homebrew install made lazy

parent 87fb024e
No related branches found
No related tags found
1 merge request!18Set of commits to be tagged v0.18.3
Pipeline #131573 passed
#!/usr/bin/env bash
[ -d "`pwd`" ] || cd
if [ -z "$BIN_DIR" ]; then
BIN_DIR=~/.local/bin
fi
......@@ -31,16 +33,19 @@ if ! command -v curl 1>/dev/null 2>&1; then
echo "Command curl required; aborting"
else
if [ "`uname`" = "Darwin" ]; then
# macOS
if ! command -v brew 1>/dev/null 2>&1; then
echo "Installing Homebrew; admin rights will be requested"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
check_brew() {
if [ "`uname`" = "Darwin" ]; then
# macOS
if ! command -v brew 1>/dev/null 2>&1; then
echo "Installing Homebrew; admin rights will be requested"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
fi
fi
}
if ! command -v realpath 1>/dev/null 2>&1; then
# macOS
check_brew
if command -v brew 1>/dev/null 2>&1; then
brew install coreutils
fi
......@@ -71,11 +76,14 @@ if [ -n "$WITH_DEFAULT_BACKEND" ]; then
if ! command -v python3.8 1>/dev/null 2>&1; then
if command -v pyenv 1>/dev/null 2>&1; then
pyenv install 3.8
elif command -v brew 1>/dev/null 2>&1; then
brew install python@3.8
else
echo "WARNING: command python3.8 not found"
echo "if under Ubuntu, consider running: sudo apt install python3.8 python3.8-venv"
check_brew
if command -v brew 1>/dev/null 2>&1; then
brew install python@3.8
else
echo "WARNING: command python3.8 not found"
echo "if under Ubuntu, consider running: sudo apt install python3.8 python3.8-venv"
fi
fi
fi
if ! command -v poetry 1>/dev/null 2>&1; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment