This repository was archived by the owner on Jun 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +13
-34
lines changed Expand file tree Collapse file tree 5 files changed +13
-34
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,15 @@ set -euo pipefail
5
5
current_script_path=${BASH_SOURCE[0]}
6
6
plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
7
7
8
- # shellcheck source=./lib/utils.bash
9
- source " ${plugin_dir} /lib/utils.bash"
10
-
11
8
mkdir -p " $ASDF_DOWNLOAD_PATH "
12
9
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"
17
11
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
+ }
20
16
21
17
# Remove the tar file since we don't need to keep it
18
+ download_version
22
19
rm " $release_file "
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
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
-
11
5
install_version () {
12
6
local install_type=" $1 "
13
7
local version=" $2 "
14
- local install_path=" ${3 %/ bin} /bin "
8
+ local install_path=" $3 "
15
9
16
10
if [ " $install_type " != " version" ]; then
17
- fail " asdf-$TOOL_NAME supports release installs only"
11
+ fail " asdf-zig supports release installs only"
18
12
fi
19
13
20
14
(
21
15
mkdir -p " $install_path "
22
16
cp -r " $ASDF_DOWNLOAD_PATH " /* " $install_path "
23
17
24
- local tool_cmd
25
- tool_cmd=" $( echo " $TOOL_TEST " | cut -d' ' -f1) "
18
+ local tool_cmd=" zig"
26
19
test -x " $install_path /$tool_cmd " || fail " Expected $install_path /$tool_cmd to be executable."
27
20
28
- echo " $TOOL_NAME $version installation was successful!"
21
+ echo " zig $version installation was successful!"
29
22
) || (
30
23
rm -rf " $install_path "
31
24
fail " An error occurred while installing $TOOL_NAME $version ."
Original file line number Diff line number Diff line change
1
+ # https://asdf-vm.com/plugins/create.html#bin-list-bin-paths
2
+
3
+ echo "."
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
shellcheck --shell=bash --external-sources \
4
4
bin/* --source-path=template/lib/ \
5
- lib/utils.bash \
6
5
scripts/*
7
6
8
7
shfmt --language-dialect bash --diff \
You can’t perform that action at this time.
0 commit comments