mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 10:37:24 -04:00 
			
		
		
		
	cmd: Assume Caddyfile if name starts with Caddyfile
And doesn't have .json extension -- in case someone names their JSON config something like Caddyfile.json, which is unconventional.
This commit is contained in:
		
							parent
							
								
									25dea2903e
								
							
						
					
					
						commit
						8c0c1a7b88
					
				| @ -137,7 +137,9 @@ func loadConfig(configFile, adapterName string) ([]byte, error) { | ||||
| 	// as a special case, if a config file called "Caddyfile" was | ||||
| 	// specified, and no adapter is specified, assume caddyfile adapter | ||||
| 	// for convenience | ||||
| 	if filepath.Base(configFile) == "Caddyfile" && adapterName == "" { | ||||
| 	if strings.HasPrefix(filepath.Base(configFile), "Caddyfile") && | ||||
| 		filepath.Ext(configFile) != ".json" && | ||||
| 		adapterName == "" { | ||||
| 		adapterName = "caddyfile" | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user