use System.run for logging Git diff

This commit is contained in:
dogboydog
2020-07-08 20:36:57 -04:00
committed by Webber Takken
parent 91ec427695
commit fdf71758a9
3 changed files with 8 additions and 6 deletions

View File

@@ -57,7 +57,10 @@ export default class Versioning {
* Log up to maxDiffLines of the git diff.
*/
static async logDiff() {
this.git(['--no-pager', 'diff', '|', 'head', '-n', this.maxDiffLines.toString()]);
await System.run('sh', undefined, {
input: Buffer.from(`git --no-pager diff | head -n ${this.maxDiffLines.toString()}`),
silent: false,
});
}
/**