From fb2f405db473e0d3de03871bcc14adc49359ebc5 Mon Sep 17 00:00:00 2001 From: Adrian Nadau Semb <31008843+ansemb@users.noreply.github.com> Date: Wed, 2 Feb 2022 23:59:25 -0800 Subject: [Bugfix]: added -ScriptBlock to run commands ```install.ps1``` (#2188) * fix(installer): use script-block to run commands * fix(installer): enforce v7 as erroraction break is not supported in v5 --- utils/installer/install.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'utils/installer/install.ps1') diff --git a/utils/installer/install.ps1 b/utils/installer/install.ps1 index 0823032a..526239bb 100644 --- a/utils/installer/install.ps1 +++ b/utils/installer/install.ps1 @@ -1,3 +1,4 @@ +#Requires -Version 7.1 $ErrorActionPreference = "Stop" # exit when command fails # set script variables @@ -139,9 +140,10 @@ function check_system_deps() { } function install_nodejs_deps() { + $dep = "node" try { - check_system_dep "node" - Invoke-Command npm install -g neovim tree-sitter-cli -ErrorAction Break + check_system_dep "$dep" + Invoke-Command -ScriptBlock { npm install --global neovim tree-sitter-cli } -ErrorAction Break } catch { print_missing_dep_msg "$dep" @@ -149,9 +151,10 @@ function install_nodejs_deps() { } function install_python_deps() { + $dep = "pip" try { - check_system_dep "pip" - Invoke-Command python -m pip install --user pynvim -ErrorAction Break + check_system_dep "$dep" + Invoke-Command -ScriptBlock { python -m pip install --user pynvim } -ErrorAction Break } catch { print_missing_dep_msg "$dep" -- cgit v1.2.3