|
|
@ -150,6 +150,7 @@ const (
|
|
|
|
Kubernetes = EnvType("k8s")
|
|
|
|
Kubernetes = EnvType("k8s")
|
|
|
|
DockerDesktop = EnvType("dde")
|
|
|
|
DockerDesktop = EnvType("dde")
|
|
|
|
Replit = EnvType("repl")
|
|
|
|
Replit = EnvType("repl")
|
|
|
|
|
|
|
|
HomeAssistantAddOn = EnvType("haao")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var envType atomic.Value // of EnvType
|
|
|
|
var envType atomic.Value // of EnvType
|
|
|
@ -255,6 +256,9 @@ func getEnvType() EnvType {
|
|
|
|
if inReplit() {
|
|
|
|
if inReplit() {
|
|
|
|
return Replit
|
|
|
|
return Replit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if inHomeAssistantAddOn() {
|
|
|
|
|
|
|
|
return HomeAssistantAddOn
|
|
|
|
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -364,6 +368,13 @@ func inDockerDesktop() bool {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func inHomeAssistantAddOn() bool {
|
|
|
|
|
|
|
|
if os.Getenv("SUPERVISOR_TOKEN") != "" || os.Getenv("HASSIO_TOKEN") != "" {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// goArchVar returns the GOARM or GOAMD64 etc value that the binary was built
|
|
|
|
// goArchVar returns the GOARM or GOAMD64 etc value that the binary was built
|
|
|
|
// with.
|
|
|
|
// with.
|
|
|
|
func goArchVar() string {
|
|
|
|
func goArchVar() string {
|
|
|
|