mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Fix work with temp directories
This commit is contained in:
@ -307,6 +307,12 @@ def cmd_in_dir(directory, prog, args=[], is_no_errors=False):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def cmd_and_return_cwd(prog, args=[], is_no_errors=False):
|
||||
cur_dir = os.getcwd()
|
||||
ret = cmd(prog, args, is_no_errors)
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def run_command(sCommand):
|
||||
popen = subprocess.Popen(sCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
result = {'stdout' : '', 'stderr' : ''}
|
||||
|
||||
@ -62,9 +62,9 @@ def make_pro_file(makefiles_dir, pro_file):
|
||||
base.delete_file(makefiles_dir + "/build.makefile_" + file_suff)
|
||||
base.cmd(qt_dir + "/bin/qmake", ["-nocache", pro_file, "CONFIG+=" + config_param] + qmake_addon)
|
||||
if ("1" == config.option("clean")):
|
||||
base.cmd_in_dir(makefiles_dir, base.app_make(), ["clean", "-f", "./build.makefile_" + file_suff], True)
|
||||
base.cmd_in_dir(makefiles_dir, base.app_make(), ["distclean", "-f", "./build.makefile_" + file_suff], True)
|
||||
base.cmd_in_dir(makefiles_dir, base.app_make(), ["-f", "./build.makefile_" + file_suff])
|
||||
base.cmd_and_return_cwd(base.app_make(), ["clean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
|
||||
base.cmd_and_return_cwd(base.app_make(), ["distclean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
|
||||
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
|
||||
else:
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
|
||||
Reference in New Issue
Block a user