mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Ensure final newline in assets/go-licenses.json (#24407)
				
					
				
			This will ensure that the file always has a final newline. I'm not sure where this bug with inconsistent final newline actually comes from, it is likely Windows-related. --------- Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
		@@ -82,6 +82,11 @@ func main() {
 | 
				
			|||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Ensure file has a final newline
 | 
				
			||||||
 | 
						if jsonBytes[len(jsonBytes)-1] != '\n' {
 | 
				
			||||||
 | 
							jsonBytes = append(jsonBytes, '\n')
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = os.WriteFile(out, jsonBytes, 0o644)
 | 
						err = os.WriteFile(out, jsonBytes, 0o644)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user