diff options
| author | Yangzi Chen <[email protected]> | 2022-02-15 00:01:21 +0800 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-14 17:01:21 +0100 | 
| commit | d16065ce585f12eacc95cd1e5f8725fc0db6a8d9 (patch) | |
| tree | 3849d166b11d1c7ef95ffca90d008d4533cd78f5 /utils/installer | |
| parent | 85acc05678d4a05c1588f8c853feaaef27c8fee3 (diff) | |
feat(installer): use pnpm to install nodejs dependencies(#2279) (#2280)
Diffstat (limited to 'utils/installer')
| -rwxr-xr-x | utils/installer/install.sh | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 309b8fdc..13679367 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -201,6 +201,12 @@ function check_system_deps() {    check_neovim_min_version  } +function __install_nodejs_deps_pnpm() { +  echo "Installing node modules with pnpm.." +  pnpm install -g "${__npm_deps[@]}" +  echo "All NodeJS dependencies are successfully installed" +} +  function __install_nodejs_deps_npm() {    echo "Installing node modules with npm.."    for dep in "${__npm_deps[@]}"; do @@ -229,6 +235,8 @@ function __validate_node_installation() {    if [ "$pkg_manager" == "npm" ]; then      manager_home="$(npm config get prefix 2>/dev/null)" +  elif [ "$pkg_manager" == "pnpm" ]; then +    manager_home="$(pnpm config get prefix 2>/dev/null)"    else      manager_home="$(yarn global bin 2>/dev/null)"    fi @@ -242,7 +250,7 @@ function __validate_node_installation() {  }  function install_nodejs_deps() { -  local -a pkg_managers=("yarn" "npm") +  local -a pkg_managers=("pnpm" "yarn" "npm")    for pkg_manager in "${pkg_managers[@]}"; do      if __validate_node_installation "$pkg_manager"; then        eval "__install_nodejs_deps_$pkg_manager" | 
