Skip to content

Commit 674f833

Browse files
committed
fix 'toString' error and improve messages
1 parent 70442ad commit 674f833

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/installer/checkGitVersion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export function checkGitVersion(): void {
66
const { status, stderr, stdout } = cp.spawnSync('git', ['--version'])
77

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

12-
const [version] = findVersions(stdout.toString())
12+
const [version] = findVersions(String(stdout))
1313

1414
if (compareVersions(version, '2.13.0') === -1) {
1515
throw new Error(`Husky requires Git >=2.13.0. Got v${version}.`)

src/installer/gitRevParse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function gitRevParse(cwd = process.cwd()): GitRevParseResult {
1616
)
1717

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

2222
const [prefix, gitCommonDir] = stdout

0 commit comments

Comments
 (0)