On Thu, Feb 6, 2020 at 1:08 PM Xu Wang <[email protected]> wrote: > Dear Leo Developer, > > I created one button in Leo, the corresponding script is: > > c.save() > g.execute_shell_commands(['git -C /Users/wwww/leodata add austin.leo', > 'git -C /Users/wwww/leodata commit -mupdates', '&git -C /Users/wwww/leodata > push']) > > > Basically, it will save the changes and do a git add/commit/push. > However, I notice the script will leave zombie process (git). See below ps > output. > > Austin-MacBook-Pro:leodata wangxu$ ps -ef | grep git > 501 88822 20009 0 2:00AM ttys000 0:00.00 grep git > 501 88678 88353 0 1:57AM ttys001 0:00.00 (git) > 501 88683 88353 0 1:57AM ttys001 0:00.00 (git) > > > Do I need to do something extra in g.execute_shell_commands ? >
Good question. Sometimes Leo appears to hang (on Windows) after running unit tests with g.execute_shell_commands. For me, a fix is to type a <return> in the console from which Leo is running. I'm not sure what else can be done. The guts of g.execute_shell_commands is just: proc = subprocess.Popen(command, shell=True) if wait: proc.communicate() You could try experimenting with shell=False, but I doubt that will work. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3a2eY5MB1JVwyOrBZaeKiywfbUui26uTn54vsXv6QW8w%40mail.gmail.com.
