def already_tapped(module, brew_path, tap):
 (rc, out, err) = module.run_command([brew_path, 'tap'])
 taps = [tap_.strip().lower() for tap_ in out.split('\n') if tap_]
 tap_name = re.sub('homebrew-', '', tap.lower())
 return (tap_name in taps)

def already_tapped ( module , brew_path , tap ) : ( rc , out , err ) = module . run_command ( [ brew_path , 'tap' ] ) taps = [ tap_ . strip ( ) . lower ( ) for tap_ in out . split ( '\n' ) if tap_ ] tap_name = re . sub ( 'homebrew-' , '' , tap . lower ( ) ) return ( tap_name in taps )
returns true if already tapped .