aboutsummaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-01-03 14:55:03 +0900
committerGitHub <noreply@github.com>2020-01-03 14:55:03 +0900
commitac4f61f82fd8d0c4b0cbabd4e364dced0c72c645 (patch)
tree2e9ab937b1c03096027ac0cbb2bc755393987a39 /installer
parent4e123ae7896ec2c11851d11b91496c2c04c6b66d (diff)
parent6c15c16a88c24a8f2c8e04bd23e34ea367f35608 (diff)
downloadvim-lsp-settings-ac4f61f82fd8d0c4b0cbabd4e364dced0c72c645.tar.gz
vim-lsp-settings-ac4f61f82fd8d0c4b0cbabd4e364dced0c72c645.tar.bz2
vim-lsp-settings-ac4f61f82fd8d0c4b0cbabd4e364dced0c72c645.zip
Merge pull request #59 from johejo/fix/multiple_npm
fix: support multiple npm packages for one language server
Diffstat (limited to 'installer')
-rwxr-xr-xinstaller/npm_install.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/installer/npm_install.sh b/installer/npm_install.sh
index 198666c..84073da 100755
--- a/installer/npm_install.sh
+++ b/installer/npm_install.sh
@@ -5,13 +5,14 @@
set -e
-npm init -y
-
-# Avoid the problem of not being able to install the same package as name in package.json.
-# Create an empty package.json.
-cat <<EOF >package.json
-{"name": ""}
-EOF
+# Supporting multiple npm packages(e.g. typescript-language-server uses typescript-language-server and tsserver).
+# If package.json exists, skip calling npm init.
+if [ ! -f package.json ]; then
+ # Avoid the problem of not being able to install the same package as name in package.json.
+ # Create an empty package.json.
+ npm init -y
+ echo '{"name": ""}' >package.json
+fi
npm install "$2"
ln -s "./node_modules/.bin/$1" .