Skip to content

Commit ea37fd2

Browse files
committed
feat: explicitly check for all external dependencies
1 parent a911616 commit ea37fd2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The format is based on [Keep a Changelog][1], and this project adheres to
1010

1111
## [Unreleased]
1212

13+
### Added
14+
15+
- Explicit safety checks for all external dependencies.
16+
1317
## [0.1.1] - 2024-08-12
1418

1519
### Changed

bw-ssh-add

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ add_ssh_key() {
137137
##### MAIN
138138

139139
# Check for dependencies
140-
if ! command -v expect &>/dev/null; then
141-
printf "Error: 'expect' command not found. Please install it and try again.\n" >&2
142-
exit 1
143-
fi
140+
for cmd in {bw,expect,ssh-add}; do
141+
if ! command -v "$cmd" &>/dev/null; then
142+
printf "Error: required command '%s' was not found. Please install it and try again.\n" "$cmd" >&2
143+
exit 1
144+
fi
145+
done
144146

145147
# Validate environment's end-of-day format if set
146148
if [[ -n ${BW_SSH_ADD_EOD:-} ]]; then

0 commit comments

Comments
 (0)