Skip to content

Commit

Permalink
Setup script (adap#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Dec 13, 2022
1 parent 1d08aa0 commit b0bb1bb
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
36 changes: 36 additions & 0 deletions baselines/dev/setup-defaults.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

if [ ! -d $HOME/.pyenv ]
then
# Install pyenv with the virtualenv plugin
curl https://pyenv.run | bash

# To add the config to the right file (depends on the shell used)
rcfile=$HOME/.$(basename $SHELL)rc

# Add pyenv to $PATH
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> $rcfile

# Init pyenv with the shell
echo 'eval "$(pyenv init -)"' >> $rcfile
echo 'eval "$(pyenv virtualenv-init -)"' >> $rcfile
source $rcfile
else
# If pyenv is already installed, check for a newer version

# If the pyenv-update plugin isn't installed do the update manually
if [ ! -d $HOME/.pyenv/plugins/pyenv-update ]
then
git -C $HOME/.pyenv pull
git -C $HOME/.pyenv/plugins/pyenv-virtualenv pull
else
pyenv update
fi
fi

# Create the virtual environment for Flower baselines
$( dirname "${BASH_SOURCE[0]}" )/venv-create.sh

# Install the dependencies inside the virtual environment
$( dirname "${BASH_SOURCE[0]}" )/bootstrap.sh
36 changes: 36 additions & 0 deletions dev/setup-defaults.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

if [ ! -d $HOME/.pyenv ]
then
# Install pyenv with the virtualenv plugin
curl https://pyenv.run | bash

# To add the config to the right file (depends on the shell used)
rcfile=$HOME/.$(basename $SHELL)rc

# Add pyenv to $PATH
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> $rcfile

# Init pyenv with the shell
echo 'eval "$(pyenv init -)"' >> $rcfile
echo 'eval "$(pyenv virtualenv-init -)"' >> $rcfile
source $rcfile
else
# If pyenv is already installed, check for a newer version

# If the pyenv-update plugin isn't installed do the update manually
if [ ! -d $HOME/.pyenv/plugins/pyenv-update ]
then
git -C $HOME/.pyenv pull
git -C $HOME/.pyenv/plugins/pyenv-virtualenv pull
else
pyenv update
fi
fi

# Create the virtual environment for Flower
$( dirname "${BASH_SOURCE[0]}" )/venv-create.sh

# Install the dependencies inside the virtual environment
$( dirname "${BASH_SOURCE[0]}" )/bootstrap.sh

0 comments on commit b0bb1bb

Please sign in to comment.