File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 22
33
44def check_installed (tool , version = "" ) -> int :
5- if version == "" :
6- command = [tool , '--version' ]
7- else :
5+ if version :
86 command = [f'{ tool } -{ version } ' , '--version' ]
7+ else :
8+ command = [tool , '--version' ]
99 try :
1010 subprocess .run (command , stdout = subprocess .PIPE )
1111 retval = 0
1212 except FileNotFoundError :
1313 # clang-tools exist because install_requires=['clang-tools'] in setup.py
1414 # install verison 13 by default if clang-tools not exist.
15- retval = subprocess .run (['clang-tools' , '-i' , '13' ], stdout = subprocess .PIPE ).returncode
15+ if version :
16+ retval = subprocess .run (['clang-tools' , '-i' , version ], stdout = subprocess .PIPE ).returncode
17+ else :
18+ retval = subprocess .run (['clang-tools' , '-i' , '13' ], stdout = subprocess .PIPE ).returncode
1619 return retval
1720
1821
You can’t perform that action at this time.
0 commit comments