Skip to content

Commit

Permalink
Merge branch 'master' of github.com:you-n-g/wan
Browse files Browse the repository at this point in the history
  • Loading branch information
you-n-g committed Mar 7, 2021
2 parents e39e08b + a166b64 commit c5e055a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,26 @@ def cmd(self, *cmd):
"""
Run command directly and notify after cmd stop or become idle
"""
logger.info(f"command: {cmd}")
logger.info(f"run command: {cmd}")
if len(cmd) > 0:
jcmd = ' '.join(str(c) for c in cmd)
proc = subprocess.Popen(jcmd, shell=True)
self.wait(proc.pid)
code = proc.wait()
return code

def wc(self, *cmd):
"""
Wait a process to end and then start a command
"""
logger.info(f"command queued: {cmd}")
if len(cmd) > 0:
self.wait()
return self.cmd(*cmd)

def pid(self):
return get_pid_via_fzf()


def ntf(message):
# notify with the call stack
Expand Down

0 comments on commit c5e055a

Please sign in to comment.