aboutsummaryrefslogtreecommitdiff
path: root/installer/install-clangd.sh
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-22 09:32:13 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-22 09:35:43 +0900
commitf4dbfd6d4005556ea2b55a1f82351add28e8872c (patch)
treeddfa49f57091a94c036c665469e64deef9eee11d /installer/install-clangd.sh
parent88adbbc7dddf2abe78d072b72e1b0f75ee81ae80 (diff)
downloadvim-lsp-settings-f4dbfd6d4005556ea2b55a1f82351add28e8872c.tar.gz
vim-lsp-settings-f4dbfd6d4005556ea2b55a1f82351add28e8872c.tar.bz2
vim-lsp-settings-f4dbfd6d4005556ea2b55a1f82351add28e8872c.zip
Support CentOS
Diffstat (limited to 'installer/install-clangd.sh')
-rwxr-xr-xinstaller/install-clangd.sh27
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