diff options
author | rob <[email protected]> | 2022-11-27 16:33:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-27 17:33:55 +0100 |
commit | 495ede0c4f0ce89c76a881f52fc9aca913b916a6 (patch) | |
tree | 54c8bbd16477d42d28585d70b84378d9123e6a05 /utils/installer/install.sh | |
parent | 1fbcaf81dc85ae2f3c6ea108557920e1741452ad (diff) |
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
Diffstat (limited to 'utils/installer/install.sh')
-rwxr-xr-x | utils/installer/install.sh | 18 |
1 files changed, 13 insertions, 5 deletions
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 [<options>]" 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 |