Skip to content

Commit 51dd7c2

Browse files
committed
WIP
1 parent 66aa6bc commit 51dd7c2

File tree

2 files changed

+110
-587
lines changed

2 files changed

+110
-587
lines changed

content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/refactor1/README.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,48 @@ A tool for running Go benchmarks using Sweet on remote GCP instances and compari
99
#### Installing pyenv
1010

1111
```bash
12-
# macOS (using Homebrew)
13-
brew update
14-
15-
# Check if pyenv is already installed (via PATH or Homebrew), install if not
16-
if which pyenv &>/dev/null || brew list pyenv &>/dev/null; then
17-
echo "pyenv is already installed"
12+
# Detect OS
13+
OS=$(uname -s)
14+
15+
if [ "$OS" = "Darwin" ]; then
16+
echo "Detected macOS, installing with Homebrew..."
17+
18+
# macOS (using Homebrew)
19+
brew update
20+
21+
# Check if pyenv is already installed (via PATH or Homebrew), install if not
22+
if which pyenv &>/dev/null || brew list pyenv &>/dev/null; then
23+
echo "pyenv is already installed"
24+
else
25+
echo "Installing pyenv..."
26+
brew install pyenv
27+
fi
28+
29+
elif [ "$OS" = "Linux" ]; then
30+
echo "Detected Linux, installing with apt-get..."
31+
32+
# Linux
33+
sudo apt-get -y update
34+
35+
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
36+
37+
# Check if pyenv is already installed
38+
if which pyenv &>/dev/null; then
39+
echo "pyenv is already installed"
40+
else
41+
echo "Installing pyenv..."
42+
curl https://pyenv.run | bash
43+
44+
# Add to your shell configuration (.bashrc, .zshrc, etc.)
45+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
46+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
47+
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
48+
fi
49+
1850
else
19-
echo "Installing pyenv..."
20-
brew install pyenv
21-
fi
22-
23-
# Linux
24-
sudo apt-get -y update
25-
26-
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
27-
28-
# Check if pyenv is already installed
29-
if which pyenv &>/dev/null; then
30-
echo "pyenv is already installed"
31-
else
32-
echo "Installing pyenv..."
33-
curl https://pyenv.run | bash
34-
35-
# Add to your shell configuration (.bashrc, .zshrc, etc.)
36-
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
37-
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
38-
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
51+
echo "Unsupported operating system: $OS"
52+
echo "Please install pyenv manually for your system."
53+
exit 1
3954
fi
4055
```
4156

0 commit comments

Comments
 (0)