Fix #353: Not Working On Windows

* First fix was only partial, allow drive letter changes.
This commit is contained in:
Jeremy Pallats/starcraft.man 2015-12-13 14:11:42 -05:00
parent b836656556
commit 24a71f9a91

View file

@ -1168,10 +1168,12 @@ class Buffer(object):
pass
class Command(object):
CD = 'cd /d' if G_IS_WIN else 'cd'
def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None):
self.cmd = cmd
if cmd_dir:
self.cmd = 'cd {0} && {1}'.format(cmd_dir, self.cmd)
self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd)
self.timeout = timeout
self.callback = cb if cb else (lambda msg: None)
self.clean = clean if clean else (lambda: None)