1
0

windows.go 622 B

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