Skip to content

Commit f350acf

Browse files
authored
check for dig and adjusts dependency check logic (#457)
2 parents 84a427e + 21e6ac0 commit f350acf

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ PADD (formerly Chronometer2) is a more expansive version of the original chronom
2727
```bash
2828
sudo chmod +x padd.sh
2929
```
30+
### Dependencies
31+
- curl
32+
- jq
33+
- dig
34+
- tput
3035

3136
## Using PADD
3237

padd.sh

+19-3
Original file line numberDiff line numberDiff line change
@@ -1517,15 +1517,31 @@ secretRead() {
15171517
}
15181518

15191519
check_dependencies() {
1520+
local hasDeps=true
15201521
# Check for required dependencies
15211522
if ! command -v curl >/dev/null 2>&1; then
15221523
printf "%b" "${check_box_bad} Error!\n 'curl' is missing but required.\n"
1523-
exit 1
1524+
hasDeps=false
15241525
fi
15251526

15261527
if ! command -v jq >/dev/null 2>&1; then
1527-
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
1528-
exit 1
1528+
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
1529+
hasDeps=false
1530+
fi
1531+
1532+
if ! command -v dig >/dev/null 2>&1; then
1533+
printf "%b" "${check_box_bad} Error!\n 'dig' is missing but required.\n"
1534+
hasDeps=false
1535+
fi
1536+
1537+
if ! command -v tput >/dev/null 2>&1; then
1538+
printf "%b" "${check_box_bad} Error!\n 'tput' is missing but required.\n"
1539+
hasDeps=false
1540+
fi
1541+
1542+
if ! [ "${hasDeps}" = true ]; then
1543+
printf "%b" "\n Please install the missing dependencies noted above.\n"
1544+
exit 1
15291545
fi
15301546
}
15311547

0 commit comments

Comments
 (0)