2019-06-13 21:31:37 -05:00
|
|
|
package shell
|
|
|
|
|
2024-01-10 18:39:58 -06:00
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"strings"
|
2024-01-25 00:39:14 -06:00
|
|
|
|
2024-01-10 18:39:58 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
2019-06-13 21:31:37 -05:00
|
|
|
|
|
|
|
func Execname(filename string) string {
|
2019-06-14 18:06:32 -05:00
|
|
|
if runtime.GOOS != "windows" {
|
|
|
|
return filename
|
2019-06-13 21:31:37 -05:00
|
|
|
}
|
2019-06-14 18:06:32 -05:00
|
|
|
return Path(filename) + ".exe"
|
|
|
|
}
|
|
|
|
|
|
|
|
func Path(filename string) string {
|
2024-01-10 18:39:58 -06:00
|
|
|
log.Log(INFO, "Path() START filename =", filename)
|
2019-06-14 18:06:32 -05:00
|
|
|
if runtime.GOOS != "windows" {
|
2024-01-10 18:39:58 -06:00
|
|
|
log.Log(INFO, "Path() END filename =", filename)
|
2019-06-14 18:06:32 -05:00
|
|
|
return filename
|
|
|
|
}
|
|
|
|
filename = strings.Replace(filename, "/", "\\", -1)
|
2024-01-10 18:39:58 -06:00
|
|
|
log.Log(INFO, "Path() END filename =", filename)
|
2019-06-13 21:31:37 -05:00
|
|
|
return filename
|
|
|
|
}
|