Skip to content

Commit 21e6ac0

Browse files
mwoolweaveryubiuser
andcommitted
dependency check adjustment
Co-authored-by: yubiuser <[email protected]> Signed-off-by: Michael Woolweaver <[email protected]>
1 parent 589b6df commit 21e6ac0

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
@@ -1516,15 +1516,31 @@ secretRead() {
15161516
}
15171517

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

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

0 commit comments

Comments
 (0)