Skip to content

Commit

Permalink
Merge pull request #1 from raimon49/fill-todo
Browse files Browse the repository at this point in the history
Implement via fill TODO sections
  • Loading branch information
raimon49 authored Nov 27, 2022
2 parents a01cab1 + 793e771 commit 16dfd6c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

</div>

Expand All @@ -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

Expand Down Expand Up @@ -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)
12 changes: 10 additions & 2 deletions bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 2 additions & 7 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
}

Expand All @@ -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"
Expand All @@ -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."
Expand Down

0 comments on commit 16dfd6c

Please sign in to comment.