-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bl to v4.0.0, rename a few vars, use template literals. (#1)
- Loading branch information
Showing
4 changed files
with
34 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
'use strict' | ||
|
||
const assert = require('assert') | ||
const bl = require('bl') | ||
const gitexec = require('./') | ||
const { BufferListStream } = require('bl') | ||
const gitexec = require('.') | ||
|
||
gitexec.exec(__dirname, 'git log --format="%H %cd"') | ||
.pipe(bl((err, data) => { | ||
if (err) { throw err } | ||
.pipe(BufferListStream((err, data) => { | ||
if (err) { | ||
throw err | ||
} | ||
|
||
data = data.toString() | ||
|
||
console.log('------------------\n', data, '------------------------') | ||
console.log(`------------------\n${data}------------------------`) | ||
const commits = data.split(/[\r\n]+/).filter(Boolean) | ||
assert.strictEqual('4525f40007bd7200d2a6c8d1e4b742f3567e83c3 Mon Dec 14 21:34:07 2015 +1100', commits[commits.length - 1]) | ||
})) | ||
|
||
gitexec.exec(__dirname, 'git log --format="%H %cd"', (err, data) => { | ||
if (err) { throw err } | ||
if (err) { | ||
throw err | ||
} | ||
|
||
console.log('------------------\n', data, '------------------------') | ||
console.log(`------------------\n${data}------------------------`) | ||
const commits = data.split(/[\r\n]+/).filter(Boolean) | ||
assert.strictEqual('4525f40007bd7200d2a6c8d1e4b742f3567e83c3 Mon Dec 14 21:34:07 2015 +1100', commits[commits.length - 1]) | ||
}) |