mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
@@ -49,15 +49,15 @@ module.exports = class RPC {
|
|||||||
// TODO: check ACL
|
// TODO: check ACL
|
||||||
// collect stdout to buffer and return it
|
// collect stdout to buffer and return it
|
||||||
const process = spawn('git', ['fetch', url, `${branch}:${branch}`], { env: { GIT_DIR: home.getCodePath(repo) } })
|
const process = spawn('git', ['fetch', url, `${branch}:${branch}`], { env: { GIT_DIR: home.getCodePath(repo) } })
|
||||||
const outBuffer = new Buffer()
|
const outBuffer = Buffer.from('')
|
||||||
const errBuffer = new Buffer()
|
const errBuffer = Buffer.from('')
|
||||||
process.stdout.on('data', data => {
|
process.stdout.on('data', data => {
|
||||||
outBuffer.push(data)
|
|
||||||
console.error('data:', JSON.stringify(data.toString()))
|
console.error('data:', JSON.stringify(data.toString()))
|
||||||
|
outBuffer.push(data)
|
||||||
})
|
})
|
||||||
process.stderr.on('data', data => {
|
process.stderr.on('data', data => {
|
||||||
errBuffer.push(data)
|
|
||||||
console.error('error:', JSON.stringify(data.toString()))
|
console.error('error:', JSON.stringify(data.toString()))
|
||||||
|
errBuffer.push(data)
|
||||||
})
|
})
|
||||||
|
|
||||||
process.on('close', code => {
|
process.on('close', code => {
|
||||||
|
|||||||
Reference in New Issue
Block a user