def run_command(self):
args = ['sfdx', 'force:apex:execute', '-f', self.file_path]
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
startupinfo=startupinfo, cwd=self.dx_folder)
p.wait()
out, err = p.communicate()
r = p.returncode
if p.returncode == 0:
printer.write('\nFinished running apex')
printer.write('\n' + str(out, 'utf-8'))
else:
printErr = err
if err is None or err == '':
printErr = out
printer.write('\nError running apex')
printer.write('\n' + str(printErr, 'utf-8'))
评论列表
文章目录