Skip to content

Commit

Permalink
Remove curl dependency (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanychev authored Jul 23, 2024
1 parent a7f4164 commit 0a8188c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -eo pipefail

download_script() {
python -c 'import urllib.request, sys; print(urllib.request.urlopen(f"{sys.argv[1]}").read().decode("utf8"))' $1
}

INSTALL_PATH="${POETRY_HOME:-$HOME/.local}"

YELLOW="\033[33m"
Expand All @@ -10,9 +14,9 @@ RESET="\033[0m"
INSTALLATION_SCRIPT="$(mktemp)"

if [ "${RUNNER_OS}" == "Windows" ]; then
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/48339106eb0d403a3c66519317488c8185844b32/install-poetry.py --output "$INSTALLATION_SCRIPT"
download_script https://raw.githubusercontent.com/python-poetry/poetry/48339106eb0d403a3c66519317488c8185844b32/install-poetry.py >"$INSTALLATION_SCRIPT"
else
curl -sSL https://install.python-poetry.org/ --output "$INSTALLATION_SCRIPT"
download_script https://install.python-poetry.org/ >"$INSTALLATION_SCRIPT"
fi

echo -e "\n${YELLOW}Setting Poetry installation path as $INSTALL_PATH${RESET}\n"
Expand Down

0 comments on commit 0a8188c

Please sign in to comment.