Commit 5363efc0 authored by Matthias Putz's avatar Matthias Putz

fixed forall with env vars on windows

parent 0518357b
...@@ -20,9 +20,11 @@ import os ...@@ -20,9 +20,11 @@ import os
import select import select
import sys import sys
import subprocess import subprocess
import portable
from color import Coloring from color import Coloring
from command import Command, MirrorSafeCommand from command import Command, MirrorSafeCommand
from repo_trace import REPO_TRACE, IsTrace, Trace
_CAN_COLOR = [ _CAN_COLOR = [
'branch', 'branch',
...@@ -68,6 +70,9 @@ at least one byte of output on stdout. ...@@ -68,6 +70,9 @@ at least one byte of output on stdout.
Environment Environment
----------- -----------
Note: Variables are referred to in the %PATH% style on Windows systems.
On unix systems in $PATH style.
pwd is the project's working directory. If the current client is pwd is the project's working directory. If the current client is
a mirror client, then pwd is the Git repository. a mirror client, then pwd is the Git repository.
...@@ -135,7 +140,7 @@ without iterating through the remaining projects. ...@@ -135,7 +140,7 @@ without iterating through the remaining projects.
if re.compile(r'^[a-z0-9A-Z_/\.-]+$').match(cmd[0]): if re.compile(r'^[a-z0-9A-Z_/\.-]+$').match(cmd[0]):
shell = False shell = False
if shell: if shell and portable.isPosix():
cmd.append(cmd[0]) cmd.append(cmd[0])
cmd.extend(opt.command[1:]) cmd.extend(opt.command[1:])
...@@ -206,6 +211,14 @@ without iterating through the remaining projects. ...@@ -206,6 +211,14 @@ without iterating through the remaining projects.
stdout = None stdout = None
stderr = None stderr = None
if not portable.isUnix():
if type(cmd) is list:
cmd = " ".join(cmd)
if IsTrace():
Trace("execute command: %s" % str(cmd).replace("%", "%%"))
Trace("environment is: %s" % str(env))
p = subprocess.Popen(cmd, p = subprocess.Popen(cmd,
cwd=cwd, cwd=cwd,
shell=shell, shell=shell,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment