#!/usr/bin/env bash

# Load common
source ${PWD}/scripts/common.sh

# Constants
HOOK_DIR=${BASE_PROJECT}/.git/hooks

# Remove all old hooks before anything
info "Removing old hooks"
rm -f ${HOOK_DIR}/commit-msg
rm -f ${HOOK_DIR}/pre-commit

# Copy new ones
info "Copy new hooks"
cp ${BASE_DIR}/hook-commit-msg.sh ${HOOK_DIR}/commit-msg
cp ${BASE_DIR}/hook-pre-commit.sh ${HOOK_DIR}/pre-commit

exit 0
#!/usr/bin/env bash

# Load common
source ${PWD}/scripts/common.sh

# Constants
HOOK_DIR=${BASE_PROJECT}/.git/hooks

# Create directory
mkdir -p ${HOOK_DIR}

# Remove all old hooks before anything
info "Removing old hooks"
rm -f ${HOOK_DIR}/commit-msg
rm -f ${HOOK_DIR}/pre-commit

# Copy new ones
info "Copy new hooks"
cp ${BASE_DIR}/hook-commit-msg.sh ${HOOK_DIR}/commit-msg
cp ${BASE_DIR}/hook-pre-commit.sh ${HOOK_DIR}/pre-commit

exit 0
Create directory if not exists
[Improved] Create directory if not exists

Signed-off-by: amannocci <460865f536eadefb7a9a9ce677e40da609b12400@gmail.com>
