windows.go 643 B

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