2019-06-13 21:31:37 -05:00
|
|
|
package shell
|
|
|
|
|
2019-06-14 20:49:54 -05:00
|
|
|
import "log"
|
2019-06-13 21:31:37 -05:00
|
|
|
import "runtime"
|
2019-06-14 18:06:32 -05:00
|
|
|
import "strings"
|
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 {
|
2019-06-14 20:49:17 -05:00
|
|
|
log.Println("shell.Path() START filename =", filename)
|
2019-06-14 18:06:32 -05:00
|
|
|
if runtime.GOOS != "windows" {
|
2019-06-14 20:49:17 -05:00
|
|
|
log.Println("shell.Path() END filename =", filename)
|
2019-06-14 18:06:32 -05:00
|
|
|
return filename
|
|
|
|
}
|
|
|
|
filename = strings.Replace(filename, "/", "\\", -1)
|
2019-06-14 20:49:17 -05:00
|
|
|
log.Println("shell.Path() END filename =", filename)
|
2019-06-13 21:31:37 -05:00
|
|
|
return filename
|
|
|
|
}
|