Skip to content

Commit

Permalink
[cli] Don't log error when running vc dev in a directory without a .g…
Browse files Browse the repository at this point in the history
…it directory (#11450)

`vc dev` in a dir without a `.git` dir would display an error the user should not see:

```
Vercel CLI 34.0.0
fatal: not a git repository (or any of the parent directories): .git
> Ready! Available at [http://localhost:3000](http://localhost:3000)
```

This fixes that by ignoring the stderr from `git rev-parse`.
  • Loading branch information
onsclom committed Apr 18, 2024
1 parent 0271501 commit 1447bc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-foxes-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vercel': patch
---

[cli] Do not pipe git stderr to user during successful `vc dev` run
1 change: 1 addition & 0 deletions packages/cli/src/util/git-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function getGitDirectory(opts: GitExecOptions): string | null {
const gitConfigPath = execSync('git rev-parse --git-dir', {
cwd,
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'ignore'],
});

return gitConfigPath;
Expand Down

0 comments on commit 1447bc0

Please sign in to comment.