diff options
author | mattn <mattn.jp@gmail.com> | 2020-01-22 09:36:49 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-22 09:36:49 +0900 |
commit | bcef74b02e0cec1f2a78137cf17ba562d8e1e470 (patch) | |
tree | ddfa49f57091a94c036c665469e64deef9eee11d | |
parent | 88adbbc7dddf2abe78d072b72e1b0f75ee81ae80 (diff) | |
parent | f4dbfd6d4005556ea2b55a1f82351add28e8872c (diff) | |
download | vim-lsp-settings-bcef74b02e0cec1f2a78137cf17ba562d8e1e470.tar.gz vim-lsp-settings-bcef74b02e0cec1f2a78137cf17ba562d8e1e470.tar.bz2 vim-lsp-settings-bcef74b02e0cec1f2a78137cf17ba562d8e1e470.zip |
Merge pull request #96 from mattn/centos
Support clangd on CentOS
-rwxr-xr-x | installer/install-clangd.sh | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh index 278792f..4e02204 100755 --- a/installer/install-clangd.sh +++ b/installer/install-clangd.sh @@ -13,7 +13,26 @@ case $os in ;; esac -distributor_id=$(lsb_release -a 2>&1 | grep 'Distributor ID' | awk '{print $3}') +if which lsb_release 2> /dev/null; then + distributor_id=$(lsb_release -a 2>&1 | grep 'Distributor ID' | awk '{print $3}') +elif [ -e /etc/fedora-release ]; then + distributor_id="Fedora" +elif [ -e /etc/redhat-release ]; then + distributor_id=$(cat /etc/redhat-release | cut -d ' ' -f 1) +elif [ -e /etc/arch-release ]; then + distributor_id="Arch" +elif [ -e /etc/SuSE-release ]; then + distributor_id="SUSE" +elif [ -e /etc/mandriva-release ]; then + distributor_id="Mandriva" +elif [ -e /etc/vine-release ]; then + distributor_id="Vine" +elif [ -e /etc/gentoo-release ]; then + distributor_id="Gentoo" +else + distributor_id="Unkown" +fi + case $distributor_id in # Check Ubuntu version Ubuntu) @@ -36,6 +55,10 @@ case $distributor_id in ;; esac ;; + # Check RedHat OS version + Fedora|Oracle|CentOS) + platform="linux-sles11.3" + ;; esac filename="clang+llvm-9.0.0-x86_64-$platform" @@ -43,7 +66,7 @@ url="http://releases.llvm.org/9.0.0/$filename.tar.xz" echo "Downloading clangd and LLVM..." curl -LO "$url" echo "Extracting archive..." -tar xf $filename.tar.xz --strip-components=1 $filename/ +xzcat $filename.tar.xz | tar x --strip-components=1 $filename/ rm $filename.tar.xz ln -sf bin/clangd ./clangd --version |