generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a configuration option to enable a reload of the .envrc every ti…
…me a run configuration is executed. This is particularly useful when working with multiple projects in separate windows that have different .envrc files.
- Loading branch information
Showing
11 changed files
with
73 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
src/main/java/systems/fehn/intellijdirenv/DirenvExecutionListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package systems.fehn.intellijdirenv; | ||
|
||
import com.intellij.execution.runners.ExecutionEnvironment; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import org.jetbrains.annotations.NotNull; | ||
import systems.fehn.intellijdirenv.services.DirenvProjectService; | ||
import systems.fehn.intellijdirenv.settings.DirenvSettingsState; | ||
|
||
|
||
class DirenvExecutionListener implements com.intellij.execution.ExecutionListener { | ||
public DirenvExecutionListener() { | ||
} | ||
|
||
@Override | ||
public void processStarting(@NotNull String executorId, @NotNull ExecutionEnvironment env) { | ||
if ( !DirenvSettingsState.getInstance().direnvSettingsImportEveryExecution ) { | ||
com.intellij.execution.ExecutionListener.super.processStarting(executorId, env); | ||
return; | ||
} | ||
|
||
Project project = env.getProject(); | ||
DirenvProjectService service = project.getService(DirenvProjectService.class); | ||
VirtualFile envrcFile = service.getProjectEnvrcFile(); | ||
if (envrcFile != null) { | ||
service.importDirenv(envrcFile, false); | ||
} | ||
com.intellij.execution.ExecutionListener.super.processStarting(executorId, env); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/kotlin/systems/fehn/intellijdirenv/services/EnvironmentService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters