WebStorm 在项目打开时运行命令或程序 [英] WebStorm run command or program on project open

查看:30
本文介绍了WebStorm 在项目打开时运行命令或程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WebStorm中打开项目后,有没有办法运行外部程序或命令?

Is there any way to run external program or command after I open project in WebStorm?

我创建了运行数据库服务器的新外部工具,在我在菜单中单击它后,它运行服务器并且一切正常,但我想在项目启动时自动启动这个工具.如果它还可以将 Web 浏览器打开到某个 url 将是数据库管理工具,那就太棒了.

I've created new external tool which runs database server, and after I click on it in menu, it runs the server and everything works, but I'd like to start this tool automatically on project start. And it'd be awesome if it could also open web browser to certain url which would be database admin tool.

推荐答案

如果您可以使用 Grunt/Gulp/npm 任务或任何其他运行/调试配置启动您想要的任务,那么是的 -- 有 启动任务 功能在 Settings/Preferences | 中可用工具 |启动任务.

If you can launch your desired task using Grunt/Gulp/npm task or any other Run/Debug Configuration then yes -- there is Startup Tasks functionality available at Settings/Preferences | Tools | Startup Tasks.

注意不能通过这种方式直接执行外部工具入口或启动任何 DOS/shell 命令.

Note that you cannot execute External Tools entry directly or launch any DOS/shell command this way.

最简单的使用方法是创建 Grunt/Gulp 任务来完成你的实际工作.在那里你可以使用 exec() 方法来执行自定义命令.

The easiest way of using this would be creating Grunt/Gulp task that would do your actual job. There you can use exec() method to execute custom command.

这篇关于WebStorm 在项目打开时运行命令或程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆