Commit 6c4960f5 authored by ale's avatar ale

do not fallback on ncurses input on Cancel

parent 034e11ae
......@@ -109,15 +109,16 @@ func promptUserDialog(path string, choices []*liber.Metadata) (*liber.Metadata,
args = append(args, strconv.Itoa(idx+1))
args = append(args, md.String())
}
log.Printf("running: %s %v", dialog, args)
var output bytes.Buffer
cmd := exec.Command(dialog, args...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = &output
if err := cmd.Run(); err != nil {
// If the user selects 'Cancel', dialog will exit with
// status 1.
log.Printf("dialog failed: %v", err)
return nil, err
return nil, nil
}
result, err := strconv.Atoi(strings.TrimSpace(output.String()))
if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment