From 31b6952a06c9cdf69e6be345b54f51bc3b84a4f9 Mon Sep 17 00:00:00 2001 From: dzdidi Date: Wed, 24 Jan 2024 12:06:24 +0000 Subject: [PATCH] push working Signed-off-by: dzdidi --- src/git-remote-pear.js | 1 - src/rpc.js | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/git-remote-pear.js b/src/git-remote-pear.js index 4944656..7149045 100755 --- a/src/git-remote-pear.js +++ b/src/git-remote-pear.js @@ -122,7 +122,6 @@ async function talkToGit (refs, drive, repoName, rpc) { // process.kill(daemonPid || home.getDaemonPid()) // home.removeDaemonPid() - console.error('response', res.toString()) // process.stdout.write(res.toString()) process.stdout.write('\n\n') process.exit(0) diff --git a/src/rpc.js b/src/rpc.js index 323692f..e105b13 100755 --- a/src/rpc.js +++ b/src/rpc.js @@ -50,21 +50,13 @@ module.exports = class RPC { // collect stdout to buffer and return it return await new Promise((resolve, reject) => { const process = spawn('git', ['fetch', url, `${branch}:${branch}`], { env: { GIT_DIR: home.getCodePath(repo) } }) - //let outBuffer = Buffer.from('') - // process.stdout.on('data', data => { - // console.error('data:', JSON.stringify(data.toString())) - // outBuffer = Buffer.concat([outBuffer, data]) - // }) - console.error('ARGS:', 'git', ['fetch', url, `${branch}:${branch}`], { env: { GIT_DIR: home.getCodePath(repo) } }) let errBuffer = Buffer.from('') process.stderr.on('data', data => { errBuffer = Buffer.concat([errBuffer, data]) - console.error('out in str:', errBuffer.toString()) }) + // TODO: write buffer to standard output with ACL process.on('close', code => { - console.error('out on close:', errBuffer.toString()) - console.error(`child process exited with code ${code}`) return code === 0 ? resolve(errBuffer) : reject(errBuffer) }) })