Execute the specified command and return the result.
(cmd, path)
| 245 | |
| 246 | |
| 247 | def exec_cmd(cmd, path): |
| 248 | """ Execute the specified command and return the result. """ |
| 249 | out = '' |
| 250 | err = '' |
| 251 | sys.stdout.write("-------- Running \"%s\" in \"%s\"...\n" % (cmd, path)) |
| 252 | parts = cmd.split() |
| 253 | try: |
| 254 | process = subprocess.Popen( |
| 255 | parts, |
| 256 | cwd=path, |
| 257 | stdout=subprocess.PIPE, |
| 258 | stderr=subprocess.PIPE, |
| 259 | shell=(sys.platform == 'win32')) |
| 260 | out, err = process.communicate() |
| 261 | except IOError, (errno, strerror): |
| 262 | raise |
| 263 | except: |
| 264 | raise |
| 265 | return {'out': out, 'err': err} |
| 266 | |
| 267 | |
| 268 | def get_git_hash(path, branch): |
no outgoing calls
no test coverage detected