File tree Expand file tree Collapse file tree 2 files changed +12
-30
lines changed Expand file tree Collapse file tree 2 files changed +12
-30
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ toolname=$(basename "$plugin_dir")
99# shellcheck source=../lib/utils.bash
1010source " ${plugin_dir} /lib/utils.bash"
1111
12+ validate_deps
1213validate_platform
1314
1415list_all_versions " ${toolname} " | sort_versions | xargs echo
Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ fail() {
1616 exit 1
1717}
1818
19+ validate_deps () {
20+
21+ deps=(jq curl)
22+
23+ for d in " ${deps[@]} " ; do
24+ if ! command -v " $d " > /dev/null; then
25+ fail " Required dependency '$d ' not found."
26+ fi
27+ done
28+ }
29+
1930curl_opts=(-fsSL)
2031
2132# NOTE: You might want to remove this if clang-tools-static is not hosted on GitHub releases.
@@ -40,36 +51,6 @@ fetch_all_assets() {
4051 jq -r ' .[0].assets[] | "\(.name) \(.browser_download_url)"'
4152}
4253
43- get_kernel () {
44-
45- local kernel
46- kernel=$( uname -s)
47-
48- case $kernel in
49- Darwin)
50- echo -n " macosx"
51- ;;
52- Linux)
53- echo -n " linux"
54- ;;
55- esac
56-
57- echo -n " "
58- }
59-
60- get_arch () {
61- local arch
62- arch=$( uname -m)
63-
64- case $arch in
65- x86_64)
66- echo -n " amd64"
67- ;;
68- esac
69-
70- echo -n " $"
71- }
72-
7354validate_platform () {
7455
7556 if [ -n " ${USE_PLATFORM} " ]; then
You can’t perform that action at this time.
0 commit comments