#!/bin/sh -e current_path="$PWD" server_path="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lsp/tsserver" [ ! -d "${server_path}" ] && mkdir -p "${server_path}" cd ${server_path} [ ! -f package.json ] && npm init -y --scope=lsp || true npm install typescript@latest typescript-language-server@latest cd ${current_path}