From 6301fab8523a224749b1479d55080e0082d3ffcd Mon Sep 17 00:00:00 2001 From: Colin Chartier Date: Tue, 2 Jul 2019 21:34:28 -0400 Subject: [PATCH] Add a descriptive error for building no services. --- commands/build.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/build.go b/commands/build.go index 93a440d..db3a4d2 100644 --- a/commands/build.go +++ b/commands/build.go @@ -59,6 +59,10 @@ func buildCommandAction(cliContext *cli.Context) error { return cli.NewExitError(err.Error(), 1) } + if len(services) == 0 { + return cli.NewExitError("you must put sanic.yaml in a directory that contains a Dockerfile somewhere within it.", 1) + } + err = build.EnsureBuildkitDaemon() if err != nil { return cli.NewExitError(err.Error(), 1)