Skip to content

Commit

Permalink
Update archive path
Browse files Browse the repository at this point in the history
  • Loading branch information
jgburet committed Sep 10, 2024
1 parent fcd4c17 commit b7c8718
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

# Dependencies

**TODO: adapt this section**

- `bash`, `curl`, `tar`, and [POSIX utilities](https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html).
- `SOME_ENV_VAR`: set this environment variable in your shell config to load the correct version of tool x.

# Install

Expand Down
1 change: 0 additions & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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"

# Download tar.gz file to the download directory
Expand Down
1 change: 0 additions & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Testing Locally:
```shell
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]

# TODO: adapt this
asdf plugin test dotenvx https://github.com/jgburet/asdf-dotenvx.git "dotenvx --version"
```

Expand Down
7 changes: 1 addition & 6 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -euo pipefail

# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for dotenvx.
GH_REPO="https://github.com/dotenvx/dotenvx"
TOOL_NAME="dotenvx"
TOOL_TEST="dotenvx --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 dotenvx 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 dotenvx
url="$GH_REPO/archive/v${version}.tar.gz"
url="$GH_REPO/releases/download/v${version}/dotenvx-${version}-$(uname -s)-$(uname -m).tar.gz"

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 dotenvx 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 b7c8718

Please sign in to comment.