mirror of
https://github.com/docker/compose.git
synced 2025-07-05 12:54:27 +02:00
Merge pull request #352 from docker/fix_error_cancel_logs
Exit without error message if user canceled command
This commit is contained in:
commit
efea5c8c83
@ -173,6 +173,11 @@ func main() {
|
|||||||
ctx = store.WithContextStore(ctx, s)
|
ctx = store.WithContextStore(ctx, s)
|
||||||
|
|
||||||
if err = root.ExecuteContext(ctx); err != nil {
|
if err = root.ExecuteContext(ctx); err != nil {
|
||||||
|
//if user canceled request, simply exit without any error message
|
||||||
|
if errors.Is(ctx.Err(), context.Canceled) {
|
||||||
|
os.Exit(130)
|
||||||
|
}
|
||||||
|
|
||||||
// Context should always be handled by new CLI
|
// Context should always be handled by new CLI
|
||||||
requiredCmd, _, _ := root.Find(os.Args[1:])
|
requiredCmd, _, _ := root.Find(os.Args[1:])
|
||||||
if requiredCmd != nil && isOwnCommand(requiredCmd) {
|
if requiredCmd != nil && isOwnCommand(requiredCmd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user