31 lines
660 B
Python
31 lines
660 B
Python
from .common import *
|
|
|
|
import shutil
|
|
import os
|
|
|
|
def prepare_tmp_folder() -> str:
|
|
if not os.path.isdir(TMP_FOLDER):
|
|
os.mkdir(TMP_FOLDER)
|
|
return TMP_FOLDER
|
|
|
|
def delete_tmp_folder():
|
|
shutil.rmtree(TMP_FOLDER)
|
|
|
|
def prepare_result_folder(subdir : str) -> str:
|
|
subdir_path = RESULT_FOLDER + '/' + subdir
|
|
if os.path.isdir(subdir_path):
|
|
shutil.rmtree(subdir_path)
|
|
os.mkdir(subdir_path)
|
|
return subdir_path
|
|
|
|
def get_toolchain_version():
|
|
try:
|
|
f = open('/workspace/version.txt', 'r')
|
|
result = f.read()
|
|
except:
|
|
result = 'Unknown'
|
|
finally:
|
|
if f:
|
|
f.close()
|
|
return result
|