waveterm/pkg/scbase/scbase.go
2022-06-30 17:02:19 -07:00

22 lines
336 B
Go

package scbase
import (
"os"
"path"
)
const HomeVarName = "HOME"
const ScHomeVarName = "SCRIPTHAUS_HOME"
func GetScHomeDir() string {
scHome := os.Getenv(ScHomeVarName)
if scHome == "" {
homeVar := os.Getenv(HomeVarName)
if homeVar == "" {
homeVar = "/"
}
scHome = path.Join(homeVar, "scripthaus")
}
return scHome
}