Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions srock-bin/build_srock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ if [ ! -d "$SROCK_THEROCK_DIR" ] ; then
exit 1
fi

srock_venv_activate

# Print the start banner similar to DONE banner, useful if fails
echo
echo "===== START $0 on $_start_date"
Expand Down
18 changes: 1 addition & 17 deletions srock-bin/setup_srock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,7 @@ fi

cd "$SROCK_THEROCK_DIR" || exit

if [ -d "$SROCK_THEROCK_DIR/.venv/bin" ] ; then
echo
echo "===== Activating virtual environment ====="
cd "$SROCK_THEROCK_DIR" || exit
echo "source .venv/bin/activate"
source ".venv/bin/activate"
else
echo
echo "===== Building virtual environment in .venv and updating PATH ====="
cd "$SROCK_THEROCK_DIR" || exit
echo "python3 -m venv .venv && source .venv/bin/activate"
# shellcheck disable=1091
python3 -m venv .venv && source ".venv/bin/activate"
fi
echo "pip install -r requirements.txt"
pip install -r requirements.txt
export PATH=$SROCK_THEROCK_DIR/.venv/bin:$PATH
srock_venv_activate

if [ "$ARG" != "restart" ]; then
echo
Expand Down
21 changes: 21 additions & 0 deletions srock-bin/srock_common_vars
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ function test_apply_patch() {
fi
}

function srock_venv_activate() {
if [ -d "$SROCK_THEROCK_DIR/.venv/bin" ] ; then
echo
echo "===== Activating virtual environment ====="
cd "$SROCK_THEROCK_DIR" || exit
echo "source .venv/bin/activate"
# shellcheck disable=1091 # don't analyze activate
source ".venv/bin/activate"
else
echo
echo "===== Building virtual environment in .venv and updating PATH ====="
cd "$SROCK_THEROCK_DIR" || exit
echo "python3 -m venv .venv && source .venv/bin/activate"
# shellcheck disable=1091 # don't analyze activate
python3 -m venv .venv && source ".venv/bin/activate"
fi
echo "pip install -r requirements.txt"
pip install -r requirements.txt
export PATH=$SROCK_THEROCK_DIR/.venv/bin:$PATH
}

SROCK="NEVER_USE_'\$SROCK'_ENV_VARIABLE" # Use SROCK_LINK

# SROCK_REPOS is the parent directory for TheRock and srock repos.
Expand Down
Loading