Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ package software.aws.toolkits.jetbrains.utils

import com.intellij.idea.AppMode
import com.intellij.ui.jcef.JBCefApp
import software.aws.toolkits.core.utils.exists
import software.aws.toolkits.core.utils.tryOrNull
import software.aws.toolkits.jetbrains.isDeveloperMode
import java.nio.file.Paths

/**
* @return true if running in any type of remote environment
Expand All @@ -16,4 +20,20 @@ fun isRunningOnRemoteBackend() = AppMode.isRemoteDevHost()
*/
fun isCodeCatalystDevEnv() = System.getenv("__DEV_ENVIRONMENT_ID") != null

fun isQWebviewsAvailable() = JBCefApp.isSupported()
/**
* @return low fidelity "is internal compute". is not exact and may fail at any time
*/
private val isInternalAmznLinuxCompute by lazy {
tryOrNull {
Paths.get("/apollo").exists()
} ?: false
}

/**
* On remote, only enabled experimentally and for internal
*/
fun isQWebviewsAvailable() = JBCefApp.isSupported() && if (!isRunningOnRemoteBackend()) {
true
} else {
isDeveloperMode() || isInternalAmznLinuxCompute
}
Loading