reitzig / sdkman-for-fish

Adds support for SDKMAN! to fish
MIT License
280 stars 13 forks source link

Silent block when sdk prompts #9

Closed reitzig closed 5 years ago

reitzig commented 5 years ago

When e.g. sdk upgrade prompts the user for input, fish-sdk does not show the prompt and silently locks.

Regression after #8, I think.

reitzig commented 5 years ago

So, using stdout of the bash process to pass data outside wasn't a good idea: not only did it mess with sdk being interactive, it also masked the status code (which I completely missed before).

With stdout/-err out of the picture, options are limited. I couldn't get named pipes to work, so it's temp files for now. Not nice, but it works.

Tests performed: those from #8, and in addition:

Status codes are passed correctly

> sdk version; echo $status

SDKMAN 5.6.5+313
0> sdk; echo $status

Usage: sdk <command> [candidate] [version]
<snip>
1

Interaction works

> sdk upgrade

Upgrade:
java (10.0.1-oracle, 8.0.171-oracle < 8.0.172-zulu)

Upgrade candidate(s) and set latest version(s) as default? (Y/n): n
>