Commit 619097cc authored by Patrick Harrison's avatar Patrick Harrison Committed by Marc Cornellà
Browse files

fix(genpass): check for presence of shuf command.

"shuf" is not a standard command on MacOS and requires installation of the brew coreutils package
parent 2a0ae331
...@@ -75,6 +75,12 @@ genpass-xkcd() { ...@@ -75,6 +75,12 @@ genpass-xkcd() {
# Generates a 128-bit XKCD-style passphrase # Generates a 128-bit XKCD-style passphrase
# EG, 9-mien-flood-Patti-buxom-dozes-ickier-pay-ailed-Foster # EG, 9-mien-flood-Patti-buxom-dozes-ickier-pay-ailed-Foster
# Can take a numerical argument for generating extra passwords # Can take a numerical argument for generating extra passwords
if (( ! $+commands[shuf] )); then
echo >&2 "$0: \`shuf\` command not found. Install coreutils (\`brew install coreutils\` on macOS)."
return 1
fi
local -i i num local -i i num
[[ $1 =~ '^[0-9]+$' ]] && num=$1 || num=1 [[ $1 =~ '^[0-9]+$' ]] && num=$1 || num=1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment