Skip to content

Commit

Permalink
Simplify checkdep function (#1)
Browse files Browse the repository at this point in the history
Minor refactoring
  • Loading branch information
jjehannet authored Nov 23, 2018
1 parent d64d739 commit 5c965be
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ipfs-wormhole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ if [ -z "${IWIPFSGATEWAY-}" ]; then
fi

# Check deps

function checkdep() {
set +e
CMDPATH="$(command -v "${1:-}")"
set -e
if [ -z "$CMDPATH" ]; then
if ! command -pv "${1:-}"; then
echo >&2 "${1:-} not found"
exit 1
fi
echo "$CMDPATH"
}

# Generate Password
Expand Down

0 comments on commit 5c965be

Please sign in to comment.