def _prefix_commands(command, which):
 prefixes = list(env.command_prefixes)
 cwd = (env.cwd if (which == 'remote') else env.lcwd)
 redirect = (' >/dev/null' if (not win32) else '')
 if cwd:
  prefixes.insert(0, ('cd %s%s' % (cwd, redirect)))
 glue = ' && '
 prefix = ((glue.join(prefixes) + glue) if prefixes else '')
 return (prefix + command)

def _prefix_commands ( command , which ) : prefixes = list ( env . command_prefixes ) cwd = ( env . cwd if ( which == 'remote' ) else env . lcwd ) redirect = ( ' >/dev/null' if ( not win32 ) else '' ) if cwd : prefixes . insert ( 0 , ( 'cd %s%s' % ( cwd , redirect ) ) ) glue = ' && ' prefix = ( ( glue . join ( prefixes ) + glue ) if prefixes else '' ) return ( prefix + command )
prefixes command with all prefixes found in env .