def run_sub_build()

in build.py [0:0]


def run_sub_build(script, directory):
	args = parse_cmdline()
	cmd = [
		sys.executable,
		script,
		'-c',
		os.path.realpath(args.config),
		'-f',
		args.format,
		'-o',
		os.path.realpath(args.output_path),
		'-p',
		os.path.realpath(args.policy_path)
	]
	call = subprocess.Popen(
		cmd,
		cwd=os.path.dirname(os.path.realpath(__file__)) + "/" + directory,
		stdout=PIPE,
		stderr=PIPE
	)
	call.wait()
	if call.returncode == 0:
		return(call.stdout.read())
	else:
		print(call.stdout.read())
		print(call.stderr.read())
		raise RuntimeError("Sub build script failed")