mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 09:09:57 +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:
		| @@ -19,7 +19,7 @@ import ( | |||||||
| func build(args []string) { | func build(args []string) { | ||||||
| 	buildCmd := flag.NewFlagSet("build", flag.ExitOnError) | 	buildCmd := flag.NewFlagSet("build", flag.ExitOnError) | ||||||
| 	buildCmd.Usage = func() { | 	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") | 		fmt.Printf("Options:\n") | ||||||
| 		buildCmd.PrintDefaults() | 		buildCmd.PrintDefaults() | ||||||
| 	} | 	} | ||||||
| @@ -35,6 +35,9 @@ func build(args []string) { | |||||||
| 		os.Exit(1) | 		os.Exit(1) | ||||||
| 	} | 	} | ||||||
| 	conf := remArgs[0] | 	conf := remArgs[0] | ||||||
|  | 	if filepath.Ext(conf) == "" { | ||||||
|  | 		conf = conf + ".yml" | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	buildInternal(*buildName, *buildPull, conf) | 	buildInternal(*buildName, *buildPull, conf) | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user