cli: Fix "build" when the basename contains a "."

Something like "moby-4.10.yml" did not work when invoked
like "moby build moby-4.10".

While at it, also allow .yaml as an extension.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-04-05 20:46:25 +01:00
parent 1602277ba7
commit ae4b9ba897

View File

@ -35,7 +35,7 @@ func build(args []string) {
os.Exit(1)
}
conf := remArgs[0]
if filepath.Ext(conf) == "" {
if !(filepath.Ext(conf) == ".yml" || filepath.Ext(conf) == ".yaml") {
conf = conf + ".yml"
}