Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions commit-stream.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import through2 from 'through2'
import { Transform } from 'node:stream'
import { stripVTControlCharacters } from 'node:util'

export default function commitStream (ghUser, ghProject) {
let commit

return through2.obj(onLine, onEnd)
return new Transform({ objectMode: true, transform: onLine, flush: onEnd })

function addLine (line) {
line = stripVTControlCharacters(line)
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@
"@semantic-release/github": "^12.0.6",
"@semantic-release/npm": "^13.1.5",
"@semantic-release/release-notes-generator": "^14.1.0",
"bl": "^6.0.1",
"conventional-changelog-conventionalcommits": "^9.3.1",
"list-stream": "^2.1.0",
"readable-stream": "^4.3.0",
"semantic-release": "^25.0.3",
"split2": "^4.2.0"
},
"dependencies": {
"through2": "^4.0.2"
},
"release": {
"branches": [
"main"
Expand Down
7 changes: 3 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import nodeTest from 'node:test'
import split2 from 'split2'
import listStream from 'list-stream'
import { pipeline } from 'readable-stream'
import bl from 'bl'

function test (name, fn) {
return nodeTest(name, (_, done) => fn({
Expand All @@ -22,13 +21,13 @@ function gitToList (t, gitCmd, user, repo, callback) {
repo = undefined
}
const child = spawn('bash', ['-c', gitCmd])
child.stderr.pipe(bl((_, out) => {
t.strictEqual(out.toString(), '')
}))
let stderr = ''
child.stderr.setEncoding('utf8').on('data', (chunk) => { stderr += chunk })
child.on('error', (err) => {
t.error(err, 'error from child')
})
child.on('close', (code) => {
t.strictEqual(stderr, '')
t.strictEqual(code, 0, 'exit code zero')
setImmediate(t.end.bind(t))
})
Expand Down
Loading