Skip to content

Commit

Permalink
fix: Remove windows path logic
Browse files Browse the repository at this point in the history
Co-authored-by: miigotu <miigotu@gmail.com>
  • Loading branch information
sondrelg and miigotu committed Oct 12, 2022
1 parent ba7d59d commit a323b40
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions main.sh
Expand Up @@ -5,11 +5,7 @@ set -eo pipefail
installation_script="$(mktemp)"
curl -sSL https://install.python-poetry.org/ --output "$installation_script"

if [ "${RUNNER_OS}" == "Windows" ]; then
path="C:/Users/runneradmin/AppData/Roaming/Python/Scripts"
else
path="$HOME/.local"
fi
path="$HOME/.local"

echo -e "\n\033[33mSetting Poetry installation path as $path\033[0m\n"
echo -e "\033[33mInstalling Poetry 👷\033[0m\n"
Expand All @@ -26,26 +22,21 @@ fi
echo "$path/bin" >>"$GITHUB_PATH"
export PATH="$path/bin:$PATH"

if [ "${RUNNER_OS}" == "Windows" ]; then
poetry_="$path/bin/poetry.exe"
else
poetry_=poetry
fi

# Expand any "~" in VIRTUALENVS_PATH
VIRTUALENVS_PATH="${VIRTUALENVS_PATH/#\~/$HOME}"

"$poetry_" config virtualenvs.create "${VIRTUALENVS_CREATE}"
"$poetry_" config virtualenvs.in-project "${VIRTUALENVS_IN_PROJECT}"
"$poetry_" config virtualenvs.path "${VIRTUALENVS_PATH}"
poetry config virtualenvs.create "${VIRTUALENVS_CREATE}"
poetry config virtualenvs.in-project "${VIRTUALENVS_IN_PROJECT}"
poetry config virtualenvs.path "${VIRTUALENVS_PATH}"

config="$("$poetry_" config --list)"
config="$(poetry config --list)"

if echo "$config" | grep -q -c "installer.parallel"; then
"$poetry_" config installer.parallel "${INSTALLER_PARALLEL}"
poetry config installer.parallel "$INSTALLER_PARALLEL"
fi

if [ "${RUNNER_OS}" == "Windows" ]; then
if [ "$RUNNER_OS" == "Windows" ]; then
# When inside a virtualenv, python uses the scripts dir, with no shortcut
act="source .venv/scripts/activate"
echo "VENV=.venv/scripts/activate" >>"$GITHUB_ENV"
else
Expand Down

0 comments on commit a323b40

Please sign in to comment.