simplify helper funcs
This commit is contained in:
parent
33cc849fc8
commit
2fe2fa20ac
1 changed files with 6 additions and 8 deletions
14
iglupkg.sh
14
iglupkg.sh
|
@ -19,24 +19,22 @@ warn() {
|
||||||
assert_file() {
|
assert_file() {
|
||||||
stat "$1" \
|
stat "$1" \
|
||||||
> /dev/null \
|
> /dev/null \
|
||||||
2> /dev/null && return
|
2> /dev/null \
|
||||||
|
|| fatal "$1 does not exist!"
|
||||||
fatal "$1 does not exist!"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_func() {
|
assert_func() {
|
||||||
command -V "$1" \
|
command -V "$1" \
|
||||||
> /dev/null \
|
> /dev/null \
|
||||||
2> /dev/null && return
|
2> /dev/null \
|
||||||
fatal "build.sh not sane: $1 not defined!"
|
|| fatal "build.sh not sane: $1 not defined!"
|
||||||
}
|
}
|
||||||
|
|
||||||
make_dir() {
|
make_dir() {
|
||||||
stat "$1" \
|
stat "$1" \
|
||||||
> /dev/null \
|
> /dev/null \
|
||||||
2> /dev/null && return
|
2> /dev/null \
|
||||||
|
|| mkdir -p "$1"
|
||||||
mkdir -p "$1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# fetch file, checks the md5sum and only curls if needed
|
# fetch file, checks the md5sum and only curls if needed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue