github.com/xraypb/xray-core@v1.6.6/common/platform/windows.go (about)

     1  //go:build windows
     2  // +build windows
     3  
     4  package platform
     5  
     6  import "path/filepath"
     7  
     8  func ExpandEnv(s string) string {
     9  	// TODO
    10  	return s
    11  }
    12  
    13  func LineSeparator() string {
    14  	return "\r\n"
    15  }
    16  
    17  func GetToolLocation(file string) string {
    18  	const name = "xray.location.tool"
    19  	toolPath := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecutableDir)
    20  	return filepath.Join(toolPath, file+".exe")
    21  }
    22  
    23  // GetAssetLocation searches for `file` in the excutable dir
    24  func GetAssetLocation(file string) string {
    25  	const name = "xray.location.asset"
    26  	assetPath := NewEnvFlag(name).GetValue(getExecutableDir)
    27  	return filepath.Join(assetPath, file)
    28  }