This repository was archived by the owner on Jun 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-37
lines changed
Expand file tree Collapse file tree 4 files changed +12
-37
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,9 @@ set -euo pipefail
55current_script_path=${BASH_SOURCE[0]}
66plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
77
8- # shellcheck source=./lib/utils.bash
9- source " ${plugin_dir} /lib/utils.bash"
10-
118mkdir -p " $ASDF_DOWNLOAD_PATH "
129
13- release_file=" ${ASDF_DOWNLOAD_PATH} /${TOOL_NAME} -${ASDF_INSTALL_VERSION} .tar.xz"
10+ release_file=" ${ASDF_DOWNLOAD_PATH} /zig -${ASDF_INSTALL_VERSION} .tar.xz"
1411
15- # Download tar.gz file to the download directory
1612" ${plugin_dir} /lib/utils.py" download " ${ASDF_INSTALL_VERSION} " " ${release_file} "
17-
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 "
20-
21- # Remove the tar file since we don't need to keep it
22- rm " $release_file "
13+ tar -xzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " --strip-components=1
Original file line number Diff line number Diff line change 22
33set -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-
115install_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 "
17+ mkdir -p " $install_path /bin"
18+ mv " $install_path /zig" " $install_path /bin/zig"
2319
24- local tool_cmd
25- tool_cmd=" $( echo " $TOOL_TEST " | cut -d' ' -f1) "
26- test -x " $install_path /$tool_cmd " || fail " Expected $install_path /$tool_cmd to be executable."
20+ local tool_cmd=" zig"
21+ if ! test -x " $install_path /bin/$tool_cmd " ; then
22+ echo " Expected $install_path /bin/zig to be executable."
23+ exit 1
24+ fi
2725
28- echo " $TOOL_NAME $version installation was successful!"
26+ echo " zig $version installation was successful!"
2927 ) || (
3028 rm -rf " $install_path "
3129 fail " An error occurred while installing $TOOL_NAME $version ."
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33shellcheck --shell=bash --external-sources \
44 bin/* --source-path=template/lib/ \
5- lib/utils.bash \
65 scripts/*
76
87shfmt --language-dialect bash --diff \
You can’t perform that action at this time.
0 commit comments