diff --git a/LICENSE b/LICENSE index a0cc687..5bbea73 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,6 @@ -TODO: INSERT YOUR NAME COPYRIGHT YEAR - MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2022 raimon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7f08d6b..674869f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # asdf-hurl [![Build](https://github.com/raimon49/asdf-hurl/actions/workflows/build.yml/badge.svg)](https://github.com/raimon49/asdf-hurl/actions/workflows/build.yml) [![Lint](https://github.com/raimon49/asdf-hurl/actions/workflows/lint.yml/badge.svg)](https://github.com/raimon49/asdf-hurl/actions/workflows/lint.yml) -[hurl](https://github.com/raimon49/asdf-hurl) plugin for the [asdf version manager](https://asdf-vm.com). +[hurl](https://hurl.dev/) plugin for the [asdf version manager](https://asdf-vm.com). @@ -16,10 +16,7 @@ # Dependencies -**TODO: adapt this section** - - `bash`, `curl`, `tar`: generic POSIX utilities. -- `SOME_ENV_VAR`: set this environment variable in your shell config to load the correct version of tool x. # Install @@ -58,4 +55,4 @@ Contributions of any kind welcome! See the [contributing guide](contributing.md) # License -See [LICENSE](LICENSE) © [raimon](https://github.com/raimon49/) +See [LICENSE](LICENSE) diff --git a/bin/download b/bin/download index b104db2..0de0276 100755 --- a/bin/download +++ b/bin/download @@ -10,8 +10,16 @@ source "${plugin_dir}/lib/utils.bash" mkdir -p "$ASDF_DOWNLOAD_PATH" -# TODO: Adapt this to proper extension and adapt extracting strategy. -release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz" +uname_s="$(uname -s)" +uname_m="$(uname -m)" +os="" + +case "$uname_s" in +Darwin) os="macos" ;; +Linux) os="linux" ;; +*) fail "OS not supported: $uname_s" ;; +esac +release_file="${TOOL_NAME}-${ASDF_INSTALL_VERSION}-${uname_m}-${os}.tar.gz" # Download tar.gz file to the download directory download_release "$ASDF_INSTALL_VERSION" "$release_file" diff --git a/lib/utils.bash b/lib/utils.bash index c4eebf2..fc46a8d 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -2,8 +2,7 @@ set -euo pipefail -# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for hurl. -GH_REPO="https://github.com/raimon49/asdf-hurl" +GH_REPO="https://github.com/Orange-OpenSource/hurl" TOOL_NAME="hurl" TOOL_TEST="hurl --version" @@ -31,8 +30,6 @@ list_github_tags() { } list_all_versions() { - # TODO: Adapt this. By default we simply list the tag names from GitHub releases. - # Change this function if hurl has other means of determining installable versions. list_github_tags } @@ -41,8 +38,7 @@ download_release() { version="$1" filename="$2" - # TODO: Adapt the release URL convention for hurl - url="$GH_REPO/archive/v${version}.tar.gz" + url="$GH_REPO/releases/download/${version}/${filename}" echo "* Downloading $TOOL_NAME release $version..." curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url" @@ -61,7 +57,6 @@ install_version() { mkdir -p "$install_path" cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path" - # TODO: Assert hurl executable exists. local tool_cmd tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)" test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable."