Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cover case where git rev-parse returns null #1001

Merged
merged 1 commit into from Jul 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -11,7 +11,7 @@ const git = (args: string[]): cp.SpawnSyncReturns<Buffer> =>

export function install(dir = '.husky'): void {
// Ensure that we're inside a git repository
if (git(['rev-parse']).status) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except, if I'm missing something, it's equivalent?

$ node
Welcome to Node.js v16.2.0.
Type ".help" for more information.
> 0 ? "a" : "b"
'b'
> 1 ? "a" : "b"
'a'
>

if (git(['rev-parse']).status !== 0) {
return
}

Expand Down