refactor templater: Add explicit note about empty-rs warnings
Due to an interesting combination of an error not being handled and Go initialising everything with what it thinks should be the default, non-existent resource sets have been gracefully handled already. This makes this accidental fix explicit. Fixes #90
This commit is contained in:
		
							parent
							
								
									2574942338
								
							
						
					
					
						commit
						9cffd3d1d4
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -66,7 +66,10 @@ func processResourceSet(c *context.Context, rs *context.ResourceSet) (*RenderedR
 | 
			
		|||
	fmt.Fprintf(os.Stderr, "Loading resources for %s\n", rs.Name)
 | 
			
		||||
 | 
			
		||||
	rp := path.Join(c.BaseDir, rs.Path)
 | 
			
		||||
	files, err := ioutil.ReadDir(rp)
 | 
			
		||||
 | 
			
		||||
	// Explicitly discard this error, which will give us an empty list of files instead.
 | 
			
		||||
	// This will end up printing a warning to the user, but it won't stop the rest of the process.
 | 
			
		||||
	files, _ := ioutil.ReadDir(rp)
 | 
			
		||||
 | 
			
		||||
	resources, err := processFiles(c, rs, rp, files)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue