mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
cli: Make the ".yml" extension optional for builds
This provides a consistent UX between build and run: moby build foo # build from foo.yml moby run foo # boot, e.g., foo-bzImage, foo-initrd.img Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
838e4814e4
commit
eda4c14aa6
@ -19,7 +19,7 @@ import (
|
||||
func build(args []string) {
|
||||
buildCmd := flag.NewFlagSet("build", flag.ExitOnError)
|
||||
buildCmd.Usage = func() {
|
||||
fmt.Printf("USAGE: %s build [options] <file.yml>\n\n", os.Args[0])
|
||||
fmt.Printf("USAGE: %s build [options] <file>[.yml]\n\n", os.Args[0])
|
||||
fmt.Printf("Options:\n")
|
||||
buildCmd.PrintDefaults()
|
||||
}
|
||||
@ -35,6 +35,9 @@ func build(args []string) {
|
||||
os.Exit(1)
|
||||
}
|
||||
conf := remArgs[0]
|
||||
if filepath.Ext(conf) == "" {
|
||||
conf = conf + ".yml"
|
||||
}
|
||||
|
||||
buildInternal(*buildName, *buildPull, conf)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user