diff --git a/cargo-dist/templates/installer/installer.sh.j2 b/cargo-dist/templates/installer/installer.sh.j2 index 9a9ab1599..c6f14cd88 100644 --- a/cargo-dist/templates/installer/installer.sh.j2 +++ b/cargo-dist/templates/installer/installer.sh.j2 @@ -447,6 +447,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -651,6 +653,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/akaikatana_basic.snap b/cargo-dist/tests/snapshots/akaikatana_basic.snap index 32081fa00..0836e91b4 100644 --- a/cargo-dist/tests/snapshots/akaikatana_basic.snap +++ b/cargo-dist/tests/snapshots/akaikatana_basic.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/akaikatana_musl.snap b/cargo-dist/tests/snapshots/akaikatana_musl.snap index 7aed5bf7d..5eb789ed0 100644 --- a/cargo-dist/tests/snapshots/akaikatana_musl.snap +++ b/cargo-dist/tests/snapshots/akaikatana_musl.snap @@ -527,6 +527,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -702,6 +704,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap b/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap index b4d3e3119..2ee8a1b04 100644 --- a/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap +++ b/cargo-dist/tests/snapshots/akaikatana_one_alias_among_many_binaries.snap @@ -531,6 +531,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -706,6 +708,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap b/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap index f55593a47..957f7f12f 100644 --- a/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap +++ b/cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap @@ -543,6 +543,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -718,6 +720,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/akaikatana_updaters.snap b/cargo-dist/tests/snapshots/akaikatana_updaters.snap index 66c938a39..1bc722920 100644 --- a/cargo-dist/tests/snapshots/akaikatana_updaters.snap +++ b/cargo-dist/tests/snapshots/akaikatana_updaters.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap index e5432ecb2..05f5ae84a 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap @@ -510,6 +510,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -685,6 +687,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap index a004e89bd..23fe5c3ee 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap @@ -510,6 +510,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -685,6 +687,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_alias.snap b/cargo-dist/tests/snapshots/axolotlsay_alias.snap index c04f78020..bc74b2409 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_alias.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_alias.snap @@ -531,6 +531,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -706,6 +708,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap b/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap index 8eb95bb13..11856cb96 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_alias_ignores_missing_bins.snap @@ -531,6 +531,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -706,6 +708,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_basic.snap index cd70fecd8..8fc311e69 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic.snap @@ -585,6 +585,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -760,6 +762,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index 82e9b1209..22269e2e7 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap b/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap index 52ab47947..d669f6de0 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2b.snap b/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2b.snap index 3639f000c..fc13623be 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2b.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2b.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2s.snap b/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2s.snap index 1746c979a..3b85e81d8 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2s.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_checksum_blake2s.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_256.snap b/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_256.snap index c6881e785..34bd4301c 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_256.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_256.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_512.snap b/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_512.snap index 21876f5d4..66631fba0 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_512.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_512.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_cross1.snap b/cargo-dist/tests/snapshots/axolotlsay_cross1.snap index 43f0ad98d..7e662af1f 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_cross1.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_cross1.snap @@ -585,6 +585,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -760,6 +762,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_cross2.snap b/cargo-dist/tests/snapshots/axolotlsay_cross2.snap index e3bf75d11..2f18008df 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_cross2.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_cross2.snap @@ -449,6 +449,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -624,6 +626,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap b/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap index 2fd78061a..8f4f571d0 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_disable_source_tarball.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_dist_url_override.snap b/cargo-dist/tests/snapshots/axolotlsay_dist_url_override.snap index d84cc9bda..50a5f9108 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dist_url_override.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dist_url_override.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap index c746084a3..79093b00b 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap index 4b20438d2..47519e6bb 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_generic_workspace_basic.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { @@ -2454,6 +2474,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -2629,6 +2651,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap b/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap index 0158b340d..c2ab76ef1 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl.snap b/cargo-dist/tests/snapshots/axolotlsay_musl.snap index 5a058da9b..af8f360b9 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl.snap @@ -527,6 +527,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -702,6 +704,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap index aa71d9675..a4435b45f 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap @@ -507,6 +507,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -682,6 +684,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap index 0c87a40bd..ee19792e4 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap b/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap index ae97855c2..99cfede62 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_several_aliases.snap @@ -531,6 +531,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -706,6 +708,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap index ce8612210..6792c0a16 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap index ce8612210..6792c0a16 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap index e341d8343..9445ee73a 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap index 95c1dd1e2..5bddd515e 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap index 03dff6906..a06de2d3f 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap index bad2b09e9..7ccbb63ac 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap index e80a402f2..42361e6fd 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap index 1fa4bd724..4c887c22b 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_cargo_home.snap b/cargo-dist/tests/snapshots/install_path_cargo_home.snap index 9b1e17f51..3df05e844 100644 --- a/cargo-dist/tests/snapshots/install_path_cargo_home.snap +++ b/cargo-dist/tests/snapshots/install_path_cargo_home.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -694,6 +696,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap index 0b30bebd3..e40891bab 100644 --- a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_subdir.snap index 213ea46fa..55a00c77a 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap index 2191d4fd2..99dce1d9c 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap index 4807d8db0..5b5b78f05 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap b/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap index d978ba9e0..9e7d950ce 100644 --- a/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap +++ b/cargo-dist/tests/snapshots/install_path_fallback_no_env_var_set.snap @@ -520,6 +520,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -690,6 +692,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap index f2e3e06ed..5073cd730 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap index 11c65426f..ce48b0126 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap index bb9801679..b8472c622 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap index 5d2ea9df2..248762b90 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap @@ -519,6 +519,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -677,6 +679,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() { diff --git a/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap b/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap index 16503723a..91f863274 100644 --- a/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap +++ b/cargo-dist/tests/snapshots/install_path_no_fallback_taken.snap @@ -520,6 +520,8 @@ install() { local _force_install_dir # Which install layout to use - "flat" or "hierarchical" local _install_layout="unspecified" + # A list of binaries which are shadowed in the PATH + local _shadowed_bins="" # Check the newer app-specific variable before falling back # to the older generic one @@ -690,6 +692,24 @@ install() { say " source $_fish_env_script_path_expr (fish)" fi fi + + _shadowed_bins="$(check_for_shadowed_bins "$_install_dir" "$_bins")" + if [ -n "$_shadowed_bins" ]; then + say "WARNING: The following commands are shadowed by other commands in your PATH:$_shadowed_bins" + fi +} + +check_for_shadowed_bins() { + local _install_dir="$1" + local _bins="$2" + + for _bin_name in $_bins; do + if [ "$(command -v "$_bin_name")" != "$_install_dir/$_bin_name" ]; then + _shadowed_bins="$_shadowed_bins $_bin_name" + fi + done + + echo "$_shadowed_bins" } print_home_for_script() {