Skip to content

Commit 8fc27ef

Browse files
committed
fix: windows stdin
1 parent bca1771 commit 8fc27ef

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/commands/plugins/install.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Command} from '@dxcli/command'
2+
import cli from 'cli-ux'
23

34
import Plugins from '../../plugins'
45

@@ -32,7 +33,9 @@ export default class PluginsInstall extends Command {
3233
if (scoped) plugin = plugin.slice(1)
3334
let [name, tag = 'latest'] = plugin.split('@')
3435
if (scoped) name = `@${name}`
36+
cli.action.start(`Installing plugin ${plugin}@${tag}`)
3537
await this.plugins.install(name, tag)
38+
cli.action.stop()
3639
}
3740
}
3841
}

src/commands/plugins/uninstall.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Command} from '@dxcli/command'
2+
import cli from 'cli-ux'
23

34
import Plugins from '../../plugins'
45

@@ -28,7 +29,9 @@ export default class PluginsUninstall extends Command {
2829
async run() {
2930
this.plugins = new Plugins(this.config)
3031
for (let plugin of this.argv) {
32+
cli.action.start(`Uninstalling ${plugin}`)
3133
await this.plugins.uninstall(plugin)
34+
cli.action.stop()
3235
}
3336
}
3437
}

src/yarn.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export default class Yarn {
2121
return new Promise((resolve, reject) => {
2222
const {fork} = require('child_process')
2323
let forked = fork(modulePath, args, options)
24+
forked.stdout.on('data', (d: any) => process.stdout.write(d))
25+
forked.stderr.on('data', (d: any) => process.stderr.write(d))
2426

2527
forked.on('error', reject)
2628
forked.on('exit', (code: number) => {
@@ -32,9 +34,9 @@ export default class Yarn {
3234
})
3335

3436
// Fix windows bug with node-gyp hanging for input forever
35-
if (this.config.windows) {
36-
forked.stdin.write('\n')
37-
}
37+
// if (this.config.windows) {
38+
// forked.stdin.write('\n')
39+
// }
3840
})
3941
}
4042

@@ -57,7 +59,7 @@ export default class Yarn {
5759
const npmRunPath = require('npm-run-path')
5860
let options = {
5961
cwd: this.cwd,
60-
stdio: [0, 1, 2, 'ipc'],
62+
stdio: [0, null, null, 'ipc'],
6163
env: npmRunPath.env({cwd: this.cwd, env: process.env}),
6264
}
6365

0 commit comments

Comments
 (0)