Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit e340146

Browse files
committed
rm utils.bash
1 parent 85c001e commit e340146

File tree

5 files changed

+13
-34
lines changed

5 files changed

+13
-34
lines changed

bin/download

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ set -euo pipefail
55
current_script_path=${BASH_SOURCE[0]}
66
plugin_dir=$(dirname "$(dirname "$current_script_path")")
77

8-
# shellcheck source=./lib/utils.bash
9-
source "${plugin_dir}/lib/utils.bash"
10-
118
mkdir -p "$ASDF_DOWNLOAD_PATH"
129

13-
release_file="${ASDF_DOWNLOAD_PATH}/${TOOL_NAME}-${ASDF_INSTALL_VERSION}.tar.xz"
14-
15-
# Download tar.gz file to the download directory
16-
"${plugin_dir}/lib/utils.py" download "${ASDF_INSTALL_VERSION}" "${release_file}"
10+
release_file="${ASDF_DOWNLOAD_PATH}/zig-${ASDF_INSTALL_VERSION}.tar.xz"
1711

18-
# Extract contents of tar.gz file into the download directory
19-
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"
12+
download_version() {
13+
"${plugin_dir}/lib/utils.py" download "${ASDF_INSTALL_VERSION}" "${release_file}"
14+
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"
15+
}
2016

2117
# Remove the tar file since we don't need to keep it
18+
download_version
2219
rm "$release_file"

bin/install

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,23 @@
22

33
set -euo pipefail
44

5-
current_script_path=${BASH_SOURCE[0]}
6-
plugin_dir=$(dirname "$(dirname "$current_script_path")")
7-
8-
# shellcheck source=./lib/utils.bash
9-
source "${plugin_dir}/lib/utils.bash"
10-
115
install_version() {
126
local install_type="$1"
137
local version="$2"
14-
local install_path="${3%/bin}/bin"
8+
local install_path="$3"
159

1610
if [ "$install_type" != "version" ]; then
17-
fail "asdf-$TOOL_NAME supports release installs only"
11+
fail "asdf-zig supports release installs only"
1812
fi
1913

2014
(
2115
mkdir -p "$install_path"
2216
cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path"
2317

24-
local tool_cmd
25-
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"
18+
local tool_cmd="zig"
2619
test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable."
2720

28-
echo "$TOOL_NAME $version installation was successful!"
21+
echo "zig $version installation was successful!"
2922
) || (
3023
rm -rf "$install_path"
3124
fail "An error occurred while installing $TOOL_NAME $version."

bin/list-bin-paths

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://asdf-vm.com/plugins/create.html#bin-list-bin-paths
2+
3+
echo "."

lib/utils.bash

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/lint.bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
shellcheck --shell=bash --external-sources \
44
bin/* --source-path=template/lib/ \
5-
lib/utils.bash \
65
scripts/*
76

87
shfmt --language-dialect bash --diff \

0 commit comments

Comments
 (0)