Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

install-pre-commit-hook.sh will error if "$(git rev-parse --git-dir)/hooks" doesn't exist #261

@mckfc

Description

@mckfc

Today I try run this script on my windows machine: install-pre-commit-hook.sh and noticed it is printing some error "??? NO Such ?????" though if flashed out.

I googled how to prevent shell script cmd closing and luckily found "sleep x" could let the window stay. And finally I found the script stop after:
cd "$(git rev-parse --git-dir)/hooks"
I open .git folder in the project and can't find any hooks folder there. I think that's why "NO SUCH ???" error raised.

I created one manually there and then run the script again. Now I can find something new in the new folder.

I never delete any folder in .git folder so not sure why the hooks folder is not there. But please add following code before cd to make sure it works:
mkdir -p "$(git rev-parse --git-dir)/hooks"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions