From baf68aa7fbd36509465c056672d7c46959ed7dd5 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 12 Jul 2023 12:17:32 -0400 Subject: [PATCH] build: assume '.' if no args are passed Signed-off-by: Jason Hall --- commands/build.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/build.go b/commands/build.go index 7feee06e..bc69c76a 100644 --- a/commands/build.go +++ b/commands/build.go @@ -415,9 +415,13 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { Use: "build [OPTIONS] PATH | URL | -", Aliases: []string{"b"}, Short: "Start a build", - Args: cli.ExactArgs(1), + Args: cli.RequiresMaxArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - options.contextPath = args[0] + if len(args) == 0 { + options.contextPath = "." + } else { + options.contextPath = args[0] + } options.builder = rootOpts.builder options.metadataFile = cFlags.metadataFile options.noCache = false