mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-05 12:39:21 +02:00
24 lines
380 B
Go
24 lines
380 B
Go
|
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"
|
||
|
}
|