def run_command(self):
dx_folder = util.dxProjectFolder()
args = ['sfdx', 'force:visualforce:component:create',
'-n', self.page_name,'-l', self.page_label, '-d', self.class_dir]
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=dx_folder)
p.wait()
out, err = p.communicate()
r = p.returncode
if p.returncode == 0:
printer.write('\nVisaulforce Component created')
file = os.path.join(self.class_dir, self.page_name + '.component')
sublime.active_window().open_file(file)
else:
printer.write('\nError creating Visualforce Component:')
printer.write('\n' + str(err, 'utf-8'))
评论列表
文章目录