Skip to content

Commit 267b73d

Browse files
committed
feat: inherit stdin so we can interact with package manager
1 parent 4d52eeb commit 267b73d

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"ipfsd-ctl": "~0.40.1",
4747
"ipfs-registry-mirror-common": "^1.0.12",
4848
"once": "^1.4.0",
49-
"output-buffer": "^1.2.0",
5049
"request": "^2.88.0",
5150
"request-promise": "^4.2.2",
5251
"which-promise": "^1.0.0",
@@ -59,6 +58,7 @@
5958
"go-ipfs-dep": "~0.4.17",
6059
"mock-require": "^3.0.2",
6160
"npm-run-all": "^4.1.3",
61+
"output-buffer": "^1.2.0",
6262
"sinon": "^7.0.0",
6363
"yarn": "^1.10.1"
6464
},

src/core/commands/proxy.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
} = require('child_process')
1111
const which = require('which-promise')
1212
const timeout = require('ipfs-registry-mirror-common/utils/timeout-promise')
13-
const OutputBuffer = require('output-buffer')
1413

1514
const cleanUpOps = []
1615

@@ -83,27 +82,14 @@ module.exports = async (options) => {
8382

8483
const proc = spawn(packageManager, [
8584
`--registry=http://localhost:${options.http.port}`
86-
].concat(process.argv.slice(2)))
87-
88-
const buffer = new OutputBuffer((line) => {
89-
console.info(`🐨 ${line}`) // eslint-disable-line no-console
90-
})
91-
92-
proc.stdout.on('data', (data) => {
93-
buffer.append(data.toString())
94-
})
95-
96-
proc.stderr.on('data', (data) => {
97-
buffer.append(data.toString())
85+
].concat(process.argv.slice(2)), {
86+
stdio: 'inherit'
9887
})
9988

10089
proc.on('close', async (code) => {
101-
buffer.flush()
102-
10390
console.log(`🎁 ${packageManager} exited with code ${code}`) // eslint-disable-line no-console
10491

10592
await rewriteLockfile(options)
106-
10793
await cleanUp()
10894

10995
process.exit(code)

0 commit comments

Comments
 (0)