From 495ede0c4f0ce89c76a881f52fc9aca913b916a6 Mon Sep 17 00:00:00 2001 From: rob Date: Sun, 27 Nov 2022 16:33:55 +0000 Subject: feat(installer): list dependencies that will be installed (#3523) * [installer] Describe which dependencies for Python, NPM, and Rust get installed * Fix formatting * Further formatting fixes * Normalise dependency installation code --- utils/installer/install.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'utils/installer') diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 872d8403..e1e748c3 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -46,6 +46,11 @@ declare -a __pip_deps=( "pynvim" ) +declare -a __rust_deps=( + "fd::fd-find" + "rg::ripgrep" +) + function usage() { echo "Usage: install.sh []" echo "" @@ -110,6 +115,10 @@ function confirm() { done } +function stringify_array() { + echo -n "${@}" | sed 's/ /, /' +} + function main() { parse_arguments "$@" @@ -122,13 +131,13 @@ function main() { if [ "$ARGS_INSTALL_DEPENDENCIES" -eq 1 ]; then if [ "$INTERACTIVE_MODE" -eq 1 ]; then - if confirm "Would you like to install LunarVim's NodeJS dependencies?"; then + if confirm "Would you like to install LunarVim's NodeJS dependencies: $(stringify_array ${__npm_deps[@]})?"; then install_nodejs_deps fi - if confirm "Would you like to install LunarVim's Python dependencies?"; then + if confirm "Would you like to install LunarVim's Python dependencies: $(stringify_array ${__pip_deps[@]})?"; then install_python_deps fi - if confirm "Would you like to install LunarVim's Rust dependencies?"; then + if confirm "Would you like to install LunarVim's Rust dependencies: $(stringify_array ${__rust_deps[@]})?"; then install_rust_deps fi else @@ -335,8 +344,7 @@ function __attempt_to_install_with_cargo() { # we try to install the missing one with cargo even though it's unlikely to be found function install_rust_deps() { - local -a deps=("fd::fd-find" "rg::ripgrep") - for dep in "${deps[@]}"; do + for dep in "${__rust_deps[@]}"; do if ! command -v "${dep%%::*}" &>/dev/null; then __attempt_to_install_with_cargo "${dep##*::}" fi -- cgit v1.2.3