xtask: Exit feedback loop on EOF
This commit is contained in:
parent
bc62192e60
commit
4bc25f836a
@ -204,7 +204,6 @@ impl ReleaseTask {
|
|||||||
|
|
||||||
/// Commit and push all the changes in the git repository.
|
/// Commit and push all the changes in the git repository.
|
||||||
fn commit(&self) -> Result<()> {
|
fn commit(&self) -> Result<()> {
|
||||||
let mut input = String::new();
|
|
||||||
let stdin = stdin();
|
let stdin = stdin();
|
||||||
|
|
||||||
let instructions = "Ready to commit the changes. [continue/abort/diff]: ";
|
let instructions = "Ready to commit the changes. [continue/abort/diff]: ";
|
||||||
@ -213,7 +212,13 @@ impl ReleaseTask {
|
|||||||
|
|
||||||
let mut handle = stdin.lock();
|
let mut handle = stdin.lock();
|
||||||
|
|
||||||
while let _ = handle.read_line(&mut input)? {
|
let mut input = String::new();
|
||||||
|
loop {
|
||||||
|
let eof = handle.read_line(&mut input)? == 0;
|
||||||
|
if eof {
|
||||||
|
return Err("User aborted commit".into());
|
||||||
|
}
|
||||||
|
|
||||||
match input.trim().to_ascii_lowercase().as_str() {
|
match input.trim().to_ascii_lowercase().as_str() {
|
||||||
"c" | "continue" => {
|
"c" | "continue" => {
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user