Skip to content

Commit

Permalink
Fix targetless selection (#200)
Browse files Browse the repository at this point in the history
* Fixed selecting targetless option in the dialog

* Changelog entry

* Update changelog.d/+targetless-selection.fixed.md

Co-authored-by: t4lz <[email protected]>

---------

Co-authored-by: t4lz <[email protected]>
  • Loading branch information
Razz4780 and t4lz authored Nov 23, 2023
1 parent 78cf440 commit c591745
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/+targetless-selection.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug with selecting `targetless` option from the target selection dialog.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.intellij.openapi.components.service
import com.intellij.openapi.progress.ProcessCanceledException
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.util.alsoIfNull
import java.nio.file.Path

/**
Expand Down Expand Up @@ -135,8 +136,9 @@ class MirrordExecManager(private val service: MirrordProjectService) {
val target = if (!targetSet) {
// There is no config file or the config does not specify a target, so show dialog.
MirrordLogger.logger.debug("target not selected, showing dialog")
chooseTarget(cli, wslDistribution, configPath).also {
if (it == MirrordExecDialog.targetlessTargetName) {
chooseTarget(cli, wslDistribution, configPath)
.takeUnless { it == MirrordExecDialog.targetlessTargetName }
.alsoIfNull {
MirrordLogger.logger.info("No target specified - running targetless")
service.notifier.notification(
"No target specified, mirrord running targetless.",
Expand All @@ -145,7 +147,6 @@ class MirrordExecManager(private val service: MirrordProjectService) {
.withDontShowAgain(MirrordSettingsState.NotificationId.RUNNING_TARGETLESS)
.fire()
}
}
} else {
null
}
Expand Down

0 comments on commit c591745

Please sign in to comment.