Skip to content

Commit

Permalink
Trimmed raw responses
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Aug 8, 2022
1 parent eeac09e commit bfd652b
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 54 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-carpets-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'simple-git': minor
---

Add a new configuration option to enable trimming white-space from the response to `git.raw`
4 changes: 4 additions & 0 deletions simple-git/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const options: Partial<SimpleGitOptions> = {
baseDir: process.cwd(),
binary: 'git',
maxConcurrentProcesses: 6,
trimmed: false,
};

// when setting all options in a single object
Expand Down Expand Up @@ -485,6 +486,9 @@ simpleGit(path).raw(commands, (err, result) => {

// using a var-args of strings and awaiting rather than using the callback
const result = await simpleGit(path).raw(...commands);

// automatically trim trailing white-space in responses
const result = await simpleGit(path, { trimmed: true }).raw(...commands);
```

# Authentication
Expand Down
Loading

0 comments on commit bfd652b

Please sign in to comment.