Xray-core/main/commands/base/env.go

24 lines
380 B
Go
Raw Normal View History

2020-11-25 14:01:53 +03:00
package base
import (
"os"
"path"
)
// CommandEnvHolder is a struct holds the environment info of commands
type CommandEnvHolder struct {
Exec string
}
// CommandEnv holds the environment info of commands
var CommandEnv CommandEnvHolder
func init() {
exec, err := os.Executable()
if err != nil {
return
}
CommandEnv.Exec = path.Base(exec)
CommandEnv.Exec = "xray"
}