aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2014-03-31 17:37:15 +0200
committerAndré Erdmann <dywi@mailerd.de>2014-03-31 17:37:15 +0200
commit5b39452838f97dd3645fb102a8f784639209ef1b (patch)
tree3562a76e2627247f6593c7271e82d99cc2b37f28 /files
parenthook functions: die_cannot_run() (diff)
downloadR_overlay-5b39452838f97dd3645fb102a8f784639209ef1b.tar.gz
R_overlay-5b39452838f97dd3645fb102a8f784639209ef1b.tar.bz2
R_overlay-5b39452838f97dd3645fb102a8f784639209ef1b.zip
hooks: use die_cannot_run()
Diffstat (limited to 'files')
-rw-r--r--files/hooks/create-metadata-cache.sh4
-rw-r--r--files/hooks/git-commit-overlay.sh2
-rw-r--r--files/hooks/git-push.sh2
-rw-r--r--files/hooks/notify-desktop.sh2
4 files changed, 7 insertions, 3 deletions
diff --git a/files/hooks/create-metadata-cache.sh b/files/hooks/create-metadata-cache.sh
index 808f537..a406d7f 100644
--- a/files/hooks/create-metadata-cache.sh
+++ b/files/hooks/create-metadata-cache.sh
@@ -14,10 +14,10 @@ set -u
#$lf ...
: ${EGENCACHE:=egencache}
-#autodie qwhich "${EGENCACHE}"
+qwhich "${EGENCACHE}" || die_cannot_run "egencache is not available."
# a valid PORTDIR is required
-[ -d "${PORTDIR-}" ] || die "\$PORTDIR '${PORTDIR-}' does not exist."
+[ -d "${PORTDIR-}" ] || die_cannot_run "\$PORTDIR '${PORTDIR-}' does not exist."
# void cleanup()
#
diff --git a/files/hooks/git-commit-overlay.sh b/files/hooks/git-commit-overlay.sh
index 2e726fb..30aad1c 100644
--- a/files/hooks/git-commit-overlay.sh
+++ b/files/hooks/git-commit-overlay.sh
@@ -17,7 +17,7 @@ set -u
## load git helper functions
$lf git
-#autodie qwhich ${GIT}
+qwhich "${GIT}" || die_cannot_run "git is not available."
## functions
diff --git a/files/hooks/git-push.sh b/files/hooks/git-push.sh
index 7d79e64..d5a410a 100644
--- a/files/hooks/git-push.sh
+++ b/files/hooks/git-push.sh
@@ -13,6 +13,8 @@ set -u
# using line_iterator() from itertools
$lf git itertools
+qwhich "${GIT}" || die_cannot_run "git is not available."
+
## functions
diff --git a/files/hooks/notify-desktop.sh b/files/hooks/notify-desktop.sh
index 9184c2f..32ae230 100644
--- a/files/hooks/notify-desktop.sh
+++ b/files/hooks/notify-desktop.sh
@@ -9,6 +9,8 @@ set -u
. "${FUNCTIONS?}" || exit
#dont_run_as_root
+qwhich notify-send || die_cannot_run "notify-send is not available."
+
## load helper functions
#$lf ...