Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove curl dependency #153

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix download
ivanychev committed Jul 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1c2ba1fc58d233731d9ad75cf0e06dcf288c50de
9 changes: 6 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
@@ -2,18 +2,21 @@

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"
RESET="\033[0m"

INSTALLATION_SCRIPT="$(mktemp)"
GET_SCRIPT_CMD="python3 -c 'import urllib.request, sys; print(urllib.request.urlopen(f\"{sys.argv[1]}\").read().decode(\"utf8\"))'"

if [ "${RUNNER_OS}" == "Windows" ]; then
${GET_SCRIPT_CMD} https://raw.githubusercontent.com/python-poetry/poetry/48339106eb0d403a3c66519317488c8185844b32/install-poetry.py > "$INSTALLATION_SCRIPT"
download_script https://raw.githubusercontent.com/python-poetry/poetry/48339106eb0d403a3c66519317488c8185844b32/install-poetry.py > "$INSTALLATION_SCRIPT"
else
${GET_SCRIPT_CMD} https://install.python-poetry.org/ > "$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"