Skip to content

Commit

Permalink
Find instelled clangd from PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
hidai committed Mar 17, 2024
1 parent b93c195 commit f0f1e5a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions installer/install-clangd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ filename() {
echo "clang+llvm-$version-$arch-$platform"
}

# Search for local clangd in PATH
for llvm_version in $(seq 30 -1 9); do
cmd="clangd-$llvm_version"
if which "$cmd" >/dev/null; then
echo "Found $(which $cmd)"

Check warning on line 104 in installer/install-clangd.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./installer/install-clangd.sh:104:25:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

Check failure on line 104 in installer/install-clangd.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck (suggestion)] reported by reviewdog 🐶 Raw Output: installer/install-clangd.sh:104:- echo "Found $(which $cmd)" installer/install-clangd.sh:104:+ echo "Found $(which "$cmd")"
ln -sf "$(which "$cmd")" clangd
./clangd --version
exit 0
fi
done

# Search for an installable clang+llvm release.
for llvm_version in 15 14 13 12 11 10 9; do
filename="$(filename "$distributor_id" "$llvm_version.0.0")"
Expand Down

0 comments on commit f0f1e5a

Please sign in to comment.