Skip to content

Commit 7cecd77

Browse files
adapt to biome specific parameters
1 parent 3dc3d95 commit 7cecd77

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div align="center">
22

3-
# asdf-biome [![Build](https://github.com/stathis-alexander/asdf-biome/actions/workflows/build.yml/badge.svg)](https://github.com/stathis-alexander/asdf-biome/actions/workflows/build.yml) [![Lint](https://github.com/stathis-alexander/asdf-biome/actions/workflows/lint.yml/badge.svg)](https://github.com/stathis-alexander/asdf-biome/actions/workflows/lint.yml)
3+
# asdf-biome [![Build](https://github.com/angellist/asdf-biome/actions/workflows/build.yml/badge.svg)](https://github.com/angellist/asdf-biome/actions/workflows/build.yml) [![Lint](https://github.com/angellist/asdf-biome/actions/workflows/lint.yml/badge.svg)](https://github.com/angellist/asdf-biome/actions/workflows/lint.yml)
44

5-
[biome](https://github.com/angellist/asdf-biome) plugin for the [asdf version manager](https://asdf-vm.com).
5+
[biome](https://github.com/biomejs/biome) plugin for the [asdf version manager](https://asdf-vm.com).
66

77
</div>
88

@@ -15,10 +15,7 @@
1515

1616
# Dependencies
1717

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

2320
# Install
2421

@@ -27,7 +24,7 @@ Plugin:
2724
```shell
2825
asdf plugin add biome
2926
# or
30-
asdf plugin add biome https://github.com/stathis-alexander/asdf-biome.git
27+
asdf plugin add biome https://github.com/angellist/asdf-biome.git
3128
```
3229

3330
biome:
@@ -53,7 +50,7 @@ install & manage versions.
5350

5451
Contributions of any kind welcome! See the [contributing guide](contributing.md).
5552

56-
[Thanks goes to these contributors](https://github.com/stathis-alexander/asdf-biome/graphs/contributors)!
53+
[Thanks goes to these contributors](https://github.com/angellist/asdf-biome/graphs/contributors)!
5754

5855
# License
5956

bin/download

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ source "${plugin_dir}/lib/utils.bash"
1010

1111
mkdir -p "$ASDF_DOWNLOAD_PATH"
1212

13-
# TODO: Adapt this to proper extension and adapt extracting strategy.
14-
release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz"
13+
release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME$(binary_suffix)"
1514

1615
# Download tar.gz file to the download directory
1716
download_release "$ASDF_INSTALL_VERSION" "$release_file"

contributing.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
Testing Locally:
44

55
```shell
6-
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]
7-
8-
# TODO: adapt this
9-
asdf plugin test biome https://github.com/stathis-alexander/asdf-biome.git "biome --version"
6+
asdf plugin test biome https://github.com/angellist/asdf-biome.git "biome --version"
107
```
118

129
Tests are automatically run in GitHub Actions on push and PR.

lib/utils.bash

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
set -euo pipefail
44

5-
# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for biome.
6-
GH_REPO="https://github.com/angellist/asdf-biome"
5+
GH_REPO="https://github.com/biomejs/biome"
76
TOOL_NAME="biome"
87
TOOL_TEST="biome --version"
98

@@ -31,18 +30,29 @@ list_github_tags() {
3130
}
3231

3332
list_all_versions() {
34-
# TODO: Adapt this. By default we simply list the tag names from GitHub releases.
35-
# Change this function if biome has other means of determining installable versions.
3633
list_github_tags
3734
}
3835

36+
binary_suffix() {
37+
local suffix
38+
39+
if [[ "$OSTYPE" == "darwin"* ]]; then
40+
suffix="-darwin-arm64"
41+
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
42+
suffix="-linux-x64"
43+
else
44+
fail "Unsupported OS: $OSTYPE"
45+
fi
46+
47+
echo "$suffix"
48+
}
49+
3950
download_release() {
4051
local version filename url
4152
version="$1"
4253
filename="$2"
4354

44-
# TODO: Adapt the release URL convention for biome
45-
url="$GH_REPO/archive/v${version}.tar.gz"
55+
url="$GH_REPO/releases/download/cli%2Fv${version}/biome$(binary_suffix)"
4656

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

64-
# TODO: Assert biome executable exists.
74+
# Assert biome executable exists.
6575
local tool_cmd
6676
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"
6777
test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable."

0 commit comments

Comments
 (0)