move dependency checks up to beginning
This commit is contained in:
parent
015dd2894f
commit
f01c7f9b53
40
urchin
40
urchin
@ -156,6 +156,26 @@ Go to https://thomaslevine.com/!/urchin/ for documentation on writing tests.
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# -------------------- Dependency checks --------------------
|
||||||
|
if command -v md5 1> /dev/null 2> /dev/null; then
|
||||||
|
urchin_md5=md5
|
||||||
|
elif command -v md5sum 1> /dev/null 2> /dev/null; then
|
||||||
|
urchin_md5=md5sum
|
||||||
|
else
|
||||||
|
echo Could not find MD5 hash command >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if epoch_date 2>&1 > /dev/null; then
|
||||||
|
epoch=epoch_date
|
||||||
|
elif epoch_pax 2>&1 > /dev/null; then
|
||||||
|
epoch=epoch_pax
|
||||||
|
else
|
||||||
|
echo I could not find a seconds counter. >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# -------------------- Portable wrappers --------------------
|
# -------------------- Portable wrappers --------------------
|
||||||
mktemp_dir() {
|
mktemp_dir() {
|
||||||
# Support HP-UX mktemp that has wrong exit codes and
|
# Support HP-UX mktemp that has wrong exit codes and
|
||||||
@ -271,26 +291,6 @@ urchin_root() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# -------------------- Dependency checks --------------------
|
|
||||||
if command -v md5 1> /dev/null 2> /dev/null; then
|
|
||||||
urchin_md5=md5
|
|
||||||
elif command -v md5sum 1> /dev/null 2> /dev/null; then
|
|
||||||
urchin_md5=md5sum
|
|
||||||
else
|
|
||||||
echo Could not find MD5 hash command >&2
|
|
||||||
urchin_exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if epoch_date 2>&1 > /dev/null; then
|
|
||||||
epoch=epoch_date
|
|
||||||
elif epoch_pax 2>&1 > /dev/null; then
|
|
||||||
epoch=epoch_pax
|
|
||||||
else
|
|
||||||
echo I could not find a seconds counter. >&2
|
|
||||||
urchin_exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# -------------------- Main stuff --------------------
|
# -------------------- Main stuff --------------------
|
||||||
recurse() {
|
recurse() {
|
||||||
requested_path="${1}"
|
requested_path="${1}"
|
||||||
|
Loading…
Reference in New Issue
Block a user