#!/bin/bash # Generates a valid /etc/eden/hooks directory in the specified directory. # # This script takes one argument, which is the directory where the valid # /etc/eden/hooks directory should be written. The specified directory may not # exist, but its parent directory must exist. HOOKS=`readlink -m "$1"` if ! [[ -d `dirname $HOOKS` && ! -e "$HOOKS" ]]; then echo "The parent of $HOOKS must exist but $HOOKS cannot exist." exit 1 fi mkdir $HOOKS # Write the post-clone script into the desired directory. TARGET=//eden/hooks/hg:post-clone buck build @mode/opt $TARGET --out $HOOKS/post-clone