Fixed temporary dir removing. Fixed printing path to log. Module checks moved to the separate file.
30 lines
616 B
Python
30 lines
616 B
Python
import os
|
|
import subprocess
|
|
|
|
|
|
def check_go(current_dir, temp_dir, test_dir):
|
|
if not os.path.exists(temp_dir + '/go'):
|
|
os.mkdir(temp_dir + '/go')
|
|
|
|
env = os.environ.copy()
|
|
env['GOPATH'] = current_dir + '/build/go'
|
|
|
|
try:
|
|
process = subprocess.Popen(
|
|
[
|
|
'go',
|
|
'build',
|
|
'-o',
|
|
temp_dir + '/go/app',
|
|
test_dir + '/go/empty/app.go',
|
|
],
|
|
env=env,
|
|
)
|
|
process.communicate()
|
|
|
|
if process.returncode == 0:
|
|
return True
|
|
|
|
except:
|
|
return None
|