#!/usr/bin/env bash
# Test rename_exe with archives that have a bin/ subdirectory structure
# Regression test: rename_exe should auto-detect bin/ when bin_path is not set

export MISE_EXPERIMENTAL=1
export MISE_GPG_VERIFY=false

# The tiny archive (e.g., tiny-2.0.0-linux-x64.tar.gz) contains:
#   tiny-2.0.0/bin/tiny
# With auto-strip (strip_components=1), it extracts to:
#   install_path/bin/tiny
# rename_exe should find the binary inside bin/ automatically

cat <<EOF >mise.toml
[tools]
"github:jdx/tiny" = { version = "2.0.0", rename_exe = "my-tiny" }
EOF

mise install
assert_contains "mise x -- my-tiny" "tiny v2."
