- Make git hook install to command
- Move hook script to infra/nnfw/git-hooks
- Change hook script name: .sh file extension
- Update format checker: remove exceptional check policy for hook script
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
check_permission() {
# Check all files except script
FILES_TO_CHECK=()
- for NON_SCRIPT_FILE in $(git ls-files -- . ':!:nnfw' ':!:run' ':!:scripts/git-hooks/*' ':!:*.sh' ':!:*.py'); do
+ for NON_SCRIPT_FILE in $(git ls-files -- . ':!:nnfw' ':!:run' ':!:*.sh' ':!:*.py'); do
FILES_TO_CHECK+=("${NON_SCRIPT_FILE}")
done
#!/usr/bin/env bash
REPO_PATH=$(git rev-parse --show-toplevel)
-REPO_HOOKS_PATH=scripts/git-hooks
+REPO_HOOKS_PATH=infra/nnfw/git-hooks
GIT_HOOKS_PATH=$REPO_PATH/.git/hooks
-REPO_PATH_REL=../.. # Relative path from REPO_HOOKS_PATH
+REPO_PATH_REL=../../../ # Relative path from REPO_HOOKS_PATH
# Create symbolic links to hooks dir
# NOTE `ln -s` does not overwrite if the file exists.
-ln -s $REPO_PATH_REL/$REPO_HOOKS_PATH/pre-push $GIT_HOOKS_PATH/pre-push
+ln -s $REPO_PATH_REL/$REPO_HOOKS_PATH/pre-push.sh $GIT_HOOKS_PATH/pre-push