File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
.github/actions/fetch_ctk Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,21 @@ runs:
22
22
- name : Install dependencies
23
23
shell : bash --noprofile --norc -xeuo pipefail {0}
24
24
run : |
25
- if (command -v curl 2>&1 >/dev/null) && (command -v zstd 2>&1 >/dev/null); then
25
+ dependencies=(zstd curl xz-utils)
26
+ dependent_exes=(zstd curl xz)
27
+
28
+ not_found=0
29
+ for dep in ${dependent_exes[@]}; do
30
+ if ! (command -v curl 2>&1 >/dev/null); then
31
+ not_found=1
32
+ break
33
+ fi
34
+ done
35
+ if [[ $not_found == 0 ]]; then
26
36
echo "All dependencies are found. Do nothing."
27
37
exit 0
28
38
fi
29
- if ! command -v sudo 2>&1 >/dev/null; then
39
+ if ! ( command -v sudo 2>&1 >/dev/null) ; then
30
40
if [[ $EUID == 0 ]]; then
31
41
alias SUDO=""
32
42
else
38
48
fi
39
49
shopt -s expand_aliases
40
50
SUDO apt update
41
- SUDO apt install -y zstd curl xz-utils
51
+ SUDO apt install -y ${dependencies[@]}
42
52
43
53
- name : Download CTK cache
44
54
id : ctk-get-cache
You can’t perform that action at this time.
0 commit comments