mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-26 18:17:24 +00:00
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)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user