Windows build: Factor out command checking
This commit is contained in:
parent
05e54b198f
commit
54019a24c3
1 changed files with 4 additions and 9 deletions
|
@ -9,19 +9,14 @@ fatal() { error "$@"; exit 1; }
|
||||||
try() { "$@" || fatal "'$@' failed"; }
|
try() { "$@" || fatal "'$@' failed"; }
|
||||||
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
||||||
|
|
||||||
|
for x in unzip wget zip; do
|
||||||
|
is_cmd "${x}" || fatal "Please install ${x}"
|
||||||
|
done
|
||||||
|
|
||||||
# Move to the folder where ep-lite is installed
|
# Move to the folder where ep-lite is installed
|
||||||
mydir=$(try cd "${0%/*}" && try pwd -P) || exit 1
|
mydir=$(try cd "${0%/*}" && try pwd -P) || exit 1
|
||||||
try cd "${mydir}/../.."
|
try cd "${mydir}/../.."
|
||||||
|
|
||||||
# Is wget installed?
|
|
||||||
is_cmd wget || fatal "Please install wget"
|
|
||||||
|
|
||||||
# Is zip installed?
|
|
||||||
is_cmd zip || fatal "Please install zip"
|
|
||||||
|
|
||||||
# Is zip installed?
|
|
||||||
is_cmd unzip || fatal "Please install unzip"
|
|
||||||
|
|
||||||
START_FOLDER=$(try pwd) || exit 1
|
START_FOLDER=$(try pwd) || exit 1
|
||||||
TMP_FOLDER=$(try mktemp -d) || exit 1
|
TMP_FOLDER=$(try mktemp -d) || exit 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue