mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Allow args/kwargs for exec command
This commit is contained in:
@ -85,9 +85,12 @@ def change_filemtime(path, time):
|
|||||||
utime(path, (time, time))
|
utime(path, (time, time))
|
||||||
|
|
||||||
|
|
||||||
def exec_command(args):
|
def exec_command(*args, **kwargs):
|
||||||
use_shell = system() == "Windows"
|
kwargs['stdout'] = PIPE
|
||||||
p = Popen(args, stdout=PIPE, stderr=PIPE, shell=use_shell)
|
kwargs['stderr'] = PIPE
|
||||||
|
kwargs['shell'] = system() == "Windows"
|
||||||
|
|
||||||
|
p = Popen(*args, **kwargs)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
return dict(out=out.strip(), err=err.strip())
|
return dict(out=out.strip(), err=err.strip())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user