Skip to content

Commit 7b4626e

Browse files
committed
Update UpdateCommon script
1 parent e0e7eb8 commit 7b4626e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Scripts/UpdateCommon.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
print("Operating system not recognized correctly")
2424
sys.exit(1)
2525

26+
SHELLTYPE = os.environ.get('SHELL')
27+
# SHELL only set for Cygwin or Linux, use "shell=False" in Popen calls
28+
SHELLARG = False
29+
if ( SHELLTYPE == None ):
30+
# on Windows, set "shell=True"
31+
SHELLARG = True
32+
2633
# GPUPerfAPI git project to folder map definitions
2734
# - GitHubMapping
2835
from UpdateCommonMap import *
@@ -44,15 +51,15 @@
4451
targetPath = os.path.normpath(tmppath)
4552
if os.path.isdir(targetPath):
4653
print("\nDirectory " + targetPath + " exists, using 'git pull' to get latest")
47-
p = subprocess.Popen(["git","pull"], cwd=targetPath)
54+
p = subprocess.Popen(["git","pull"], cwd=targetPath, shell=SHELLARG)
4855
p.wait();
4956
else:
5057
print("\nDirectory " + targetPath + " does not exist, using 'git clone' to get latest")
5158
gitamdRoot = "https://github.com/GPUOpen-Tools/" + key
5259
commandArgs = ["git", "clone", gitamdRoot, targetPath]
53-
p = subprocess.Popen( commandArgs )
60+
p = subprocess.Popen(commandArgs, shell=SHELLARG)
5461
p.wait()
55-
p = subprocess.Popen(["git","reset","--hard",GitHubMapping[key][1]], cwd=targetPath)
62+
p = subprocess.Popen(["git","reset","--hard",GitHubMapping[key][1]], cwd=targetPath, shell=SHELLARG)
5663
p.wait()
5764

5865
# Downloads and runs an installer for a Common Dir (just used for VulkanSDK currently)

0 commit comments

Comments
 (0)