kiss-hook

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

README.md (1982B)


      1 kiss-hook manager
      2 -----------------
      3 
      4 A directory based kiss-hook manager. I prefer to use this structure now after
      5 having a single script with tons of `case` statements. It was hard to read and
      6 hard to manage.
      7 
      8 
      9 Installation
     10 ------------
     11 
     12 If you want to install this, copy (or symlink) the `kiss-hook` file to the
     13 directory you will be using as the hook directory. You will then need to
     14 set the `$KISS_HOOK` variable pointing to this script.
     15 
     16 If you don't want to put this script to the hook directory, you can set the
     17 environment variable `$KISS_HOOK_DIR` pointing to that directory.
     18 
     19 Same applies for the `cpt-hook` file and the hook variables.
     20 
     21 
     22 Setting up hooks
     23 ----------------
     24 
     25 For every hook, you can set up a directory or a single file with the name of the
     26 hook. You can add a file named `lib` to the hook directory which will be sourced
     27 for every hook. This is useful for using functions on multiple hook types.
     28 
     29 For example with the `post-build` hook, if you have package specific
     30 configuration you create a directory named `post-build/`. In it you will have
     31 files for all packages that you want to hook into. If you are hooking `gcc`,
     32 `sbase`, and `less` you will have `post-build/gcc` `post-build/sbase`, and
     33 `post-build/less` files. If you also want a hook that will affect every package
     34 you will need to add `post-build/post-build`.
     35 
     36 If you don't have a package specific hook, but you want a hook that will deal
     37 with every package (or a hook that doesn't even deal with packages), you can
     38 simply create a file for the hook.
     39 
     40 Here is an example structure:
     41 
     42 
     43     ├── kiss-hook
     44     ├── lib
     45     ├── post-build
     46     │   ├── gcc
     47     │   ├── less
     48     │   ├── post-build
     49     │   └── sbase
     50     ├── post-install
     51     │   └── linux
     52     ├── pre-build
     53     └── pre-fetch
     54 
     55 See [my personal repository] for a better example on the hooks.
     56 
     57 [my personal repository]: https://github.com/cemkeylan/hooks