Loading git-hooks +20 −15 Original line number Diff line number Diff line Loading @@ -80,7 +80,11 @@ cmd_init () _basic_check () { contains "$HOOKS" "$hook" || die "unknown hook '$hook'" if ! contains "$HOOKS" "$hook"; then echo -n "Usage: " parse_args $1 --help || true die "unknown hook '$hook'" fi [ -d "$GIT_DIR"/hooks/$hook.d ] || \ die "the '$hook' hook directory does not appear to exist, you should \ run 'git-hooks init'" Loading @@ -95,7 +99,8 @@ _change_check () _installed_check () { [ -e "$GIT_DIR"/hooks/$hook.d/"$script" ] || \ [ -e "$GIT_DIR"/hooks/$hook.d/"$script" ] && \ ! [ -d "$GIT_DIR"/hooks/$hook.d/"$script" ] || \ die "there is no script '$script' in the '$hook' hook directory" } Loading @@ -106,8 +111,8 @@ cmd_add () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _basic_check "$@" _change_check "$@" [ -e "$script" ] || die "unknown script '$script'" [ -e "$GIT_DIR"/hooks/$hook.d/"`basename "$script"`" ] && \ Loading @@ -124,9 +129,9 @@ cmd_remove () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" rm "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -138,9 +143,9 @@ cmd_enable () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" chmod +x "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -152,9 +157,9 @@ cmd_disable () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" chmod -x "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -165,7 +170,7 @@ cmd_installed () local hook add_option hook yes parse_args "$@" || return _basic_check _basic_check "$@" cd "$GIT_DIR"/hooks/$hook.d find -type f -printf '%P\n' Loading Loading
git-hooks +20 −15 Original line number Diff line number Diff line Loading @@ -80,7 +80,11 @@ cmd_init () _basic_check () { contains "$HOOKS" "$hook" || die "unknown hook '$hook'" if ! contains "$HOOKS" "$hook"; then echo -n "Usage: " parse_args $1 --help || true die "unknown hook '$hook'" fi [ -d "$GIT_DIR"/hooks/$hook.d ] || \ die "the '$hook' hook directory does not appear to exist, you should \ run 'git-hooks init'" Loading @@ -95,7 +99,8 @@ _change_check () _installed_check () { [ -e "$GIT_DIR"/hooks/$hook.d/"$script" ] || \ [ -e "$GIT_DIR"/hooks/$hook.d/"$script" ] && \ ! [ -d "$GIT_DIR"/hooks/$hook.d/"$script" ] || \ die "there is no script '$script' in the '$hook' hook directory" } Loading @@ -106,8 +111,8 @@ cmd_add () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _basic_check "$@" _change_check "$@" [ -e "$script" ] || die "unknown script '$script'" [ -e "$GIT_DIR"/hooks/$hook.d/"`basename "$script"`" ] && \ Loading @@ -124,9 +129,9 @@ cmd_remove () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" rm "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -138,9 +143,9 @@ cmd_enable () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" chmod +x "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -152,9 +157,9 @@ cmd_disable () add_option hook yes add_option script yes parse_args "$@" || return _basic_check _change_check _installed_check _basic_check "$@" _change_check "$@" _installed_check "$@" chmod -x "$GIT_DIR"/hooks/$hook.d/"$script" } Loading @@ -165,7 +170,7 @@ cmd_installed () local hook add_option hook yes parse_args "$@" || return _basic_check _basic_check "$@" cd "$GIT_DIR"/hooks/$hook.d find -type f -printf '%P\n' Loading