Skip to content

Commit

Permalink
fix 'toString' error and improve messages
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 15, 2021
1 parent 70442ad commit 674f833
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/installer/checkGitVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export function checkGitVersion(): void {
const { status, stderr, stdout } = cp.spawnSync('git', ['--version'])

if (status !== 0) {
throw new Error(stderr.toString())
throw new Error(`git --version command failed. Got ${String(stderr)}.`)
}

const [version] = findVersions(stdout.toString())
const [version] = findVersions(String(stdout))

if (compareVersions(version, '2.13.0') === -1) {
throw new Error(`Husky requires Git >=2.13.0. Got v${version}.`)
Expand Down
2 changes: 1 addition & 1 deletion src/installer/gitRevParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function gitRevParse(cwd = process.cwd()): GitRevParseResult {
)

if (status !== 0) {
throw new Error(stderr.toString())
throw new Error(`git rev-parse command failed. Got ${String(stderr)}`)
}

const [prefix, gitCommonDir] = stdout
Expand Down

0 comments on commit 674f833

Please sign in to comment.