diff options
author | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2014-01-06 13:36:04 +0100 |
---|---|---|
committer | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2014-01-21 14:22:47 +0100 |
commit | 787ff55283067ef3d8da3238e65ca204bc63b3f9 (patch) | |
tree | 41d3a2e27912b1f5a1ae9adedba20c5deada3b7f /contrib/mkimage-arch.sh | |
parent | da4ba80733ff4826ea17d253677a58fdedf4cc00 (diff) | |
download | docker-787ff55283067ef3d8da3238e65ca204bc63b3f9.tar.gz |
mkimage-arch: use hash to check if command is available
Apart from having more predictable return codes on various operating
systems, it additionally caches the path to application.
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
Diffstat (limited to 'contrib/mkimage-arch.sh')
-rwxr-xr-x | contrib/mkimage-arch.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/mkimage-arch.sh b/contrib/mkimage-arch.sh index 41070aedb1..da11750c03 100755 --- a/contrib/mkimage-arch.sh +++ b/contrib/mkimage-arch.sh @@ -4,14 +4,12 @@ # requires root set -e -PACSTRAP=$(hash pacstrap &>/dev/null) -[ "$PACSTRAP" ] || { +hash pacstrap &>/dev/null || { echo "Could not find pacstrap. Run pacman -S arch-install-scripts" exit 1 } -EXPECT=$(hash expect &>/dev/null) -[[ "$EXPECT" ]] || { +hash expect &>/dev/null || { echo "Could not find expect. Run pacman -S expect" exit 1 } |