From e64763496b42a9a127776d13653790db6b3f74e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Lilleb=C3=B8=20Gundersen?= Date: Tue, 11 Oct 2022 13:27:12 +0800 Subject: [PATCH] fix: Remove windows path logic Co-authored-by: miigotu --- main.sh | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/main.sh b/main.sh index b4239bee..00b8ca68 100755 --- a/main.sh +++ b/main.sh @@ -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" @@ -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