Skip to content

Commit

Permalink
Fix TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
b1-luettje committed Feb 20, 2024
1 parent 526b248 commit a5823e9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 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 (if applicable to your license)

MIT License

Copyright (c) [year] [fullname]
Copyright (c) [2024]

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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

# 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.

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 uv https://github.com/b1-luettje/asdf-uv.git "uv --version"
```

Expand Down
23 changes: 16 additions & 7 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 uv.
GH_REPO="https://github.com/astral-sh/uv"
TOOL_NAME="uv"
TOOL_TEST="uv --version"
Expand Down Expand Up @@ -31,18 +30,29 @@ list_github_tags() {
}

list_all_versions() {
# TODO: Adapt this. By default we simply list the tag names from GitHub releases.
# Change this function if uv has other means of determining installable versions.
list_github_tags
}

download_release() {
local version filename url
local version filename url architecture unameOut os
version="$1"
filename="$2"

# TODO: Adapt the release URL convention for uv
url="$GH_REPO/archive/v${version}.tar.gz"
architecture="$(uname --machine)"
unameOut="$(uname -s)"
case "${unameOut}" in
"Linux")
libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
if [ -z "$libc" ]; then
os='unknown-linux-gnu'
else
os='unknown-linux-musl'
fi
;;
Darwin) os='apple-darwin' ;;
esac

url="${GH_REPO}/releases/download/${version}/uv-${architecture}-${os}.tar.gz"

echo "* Downloading $TOOL_NAME release $version..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
Expand All @@ -61,7 +71,6 @@ install_version() {
mkdir -p "$install_path"
cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path"

# TODO: Assert uv 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 a5823e9

Please sign in to comment.