Xray-core/main/commands/base/env.go
2024-07-12 00:20:06 +02:00

27 lines
482 B
Go

package base
import (
"os"
"path"
)
// CommandEnvHolder is a struct holds the environment info of commands
type CommandEnvHolder struct {
// Executable name of current binary
Exec string
// commands column width of current command
CommandsWidth int
}
// 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"
}