Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix install support for vhs >= v0.7.2 #11

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,25 @@ install_version() {
local install_type="$1"
local version="$2"
local install_path="$3"
local tool_cmd
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"

if [ "$install_type" != "version" ]; then
fail "asdf-$TOOL_NAME supports release installs only"
fi

(
local tool_cmd
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"
# Check if a directory matching ${tool_cmd}_${version}_* exists in the extracted archive in $ASDF_DOWNLOAD_PATH.
# This addresses a change made by Charmbracelet to the way vhs is packaged.
# If there is, update the ASDF_DOWNLOAD_PATH to that directory.
# See https://github.com/charmbracelet/meta/pull/140 for more info.
for dir in "$ASDF_DOWNLOAD_PATH"/"${tool_cmd}_${version}"_*; do
if [ -d "$dir" ]; then
ASDF_DOWNLOAD_PATH="$dir"
break
fi
done

(
mkdir -p "$install_path"/bin
cp "$ASDF_DOWNLOAD_PATH"/"$tool_cmd" "$install_path"/bin

Expand Down