kiss-hook

directory based kiss-hook manager
git clone git://git.ckyln.com/~cem/kiss-hook
Log | Files | Refs | README | LICENSE

kiss-hook (596B)


      1 #!/bin/sh -e
      2 # shellcheck disable=1090
      3 # A directory based kiss-hook manager.
      4 
      5 hook() {
      6     [ -e "${KISS_HOOK_DIR:=${KISS_HOOK%/*}}/$TYPE" ] || return 0
      7     [ -e "$KISS_HOOK_DIR/lib" ] && . "$KISS_HOOK_DIR/lib"
      8 
      9     [ -d "$KISS_HOOK_DIR/$TYPE" ] || {
     10         . "$KISS_HOOK_DIR/$TYPE"
     11         return
     12     }
     13 
     14     [ -f "$KISS_HOOK_DIR/$TYPE/$TYPE" ] && . "$KISS_HOOK_DIR/$TYPE/$TYPE"
     15     [ -f "$KISS_HOOK_DIR/$TYPE/$PKG"  ] && . "$KISS_HOOK_DIR/$TYPE/$PKG"
     16 
     17     # We are returning with success, since the package manager already exits
     18     # with in an error caused by the hooks.
     19     return 0
     20 }
     21 
     22 hook