打开 IntelliJ 项目时如何执行终端命令?
How can I execute a terminal command when opening IntelliJ Project?
甚至不确定这是否适用于 IntelliJ,但我想在打开 IntelliJ 项目时自动将 vagrant up
命令绑定到 运行。我已经搜索了这些设置,但没能找到任何能给我这个功能的东西。
你可以写一个插件。
https://www.jetbrains.com/help/idea/plugin-development-guidelines.html
在 plugin.xml
中定义一个应用程序组件
<application-components>
<component>
<implementation-class>com.steve.plugins.recentprojects.RecentProjects</implementation-class>
</component>
</application-components>
然后您实现 ApplicationComponent
,它在父接口中定义了这些方法:
public interface BaseComponent extends com.intellij.openapi.components.NamedComponent {
default void initComponent() { /* compiled code */ }
default void disposeComponent() { /* compiled code */ }
}
似乎 initComponent()
是插入函数以启动 vagrant 的好地方。
或者...外部化启动,编写启动 vagrant 然后启动 intellij 的脚本...
甚至不确定这是否适用于 IntelliJ,但我想在打开 IntelliJ 项目时自动将 vagrant up
命令绑定到 运行。我已经搜索了这些设置,但没能找到任何能给我这个功能的东西。
你可以写一个插件。
https://www.jetbrains.com/help/idea/plugin-development-guidelines.html
在 plugin.xml
中定义一个应用程序组件<application-components>
<component>
<implementation-class>com.steve.plugins.recentprojects.RecentProjects</implementation-class>
</component>
</application-components>
然后您实现 ApplicationComponent
,它在父接口中定义了这些方法:
public interface BaseComponent extends com.intellij.openapi.components.NamedComponent {
default void initComponent() { /* compiled code */ }
default void disposeComponent() { /* compiled code */ }
}
似乎 initComponent()
是插入函数以启动 vagrant 的好地方。
或者...外部化启动,编写启动 vagrant 然后启动 intellij 的脚本...