tests: validate developer bash commands
Also change the logic a bit to iterate over the individual files per directory, as having a directory without bash commands will otherwise pass a literal `*.sh` to `bash -n`, causing it to fail. Closes Homebrew/homebrew#48323. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This commit is contained in:
		
							parent
							
								
									77975168e0
								
							
						
					
					
						commit
						99fd172ea8
					
				@ -11,6 +11,10 @@ class BashTests < Homebrew::TestCase
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_bash_cmds
 | 
			
		||||
    assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH}/cmd/*.sh"
 | 
			
		||||
    %w[cmd dev-cmd].each do |dir|
 | 
			
		||||
      Dir["#{HOMEBREW_LIBRARY_PATH}/#{dir}/*.sh"].each do |cmd|
 | 
			
		||||
        assert_valid_bash_syntax cmd
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user