2019-06-13 21:31:37 -05:00
|
|
|
package shell
|
|
|
|
|
|
|
|
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 {
|
|
|
|
if runtime.GOOS != "windows" {
|
|
|
|
return filename
|
|
|
|
}
|
|
|
|
filename = strings.Replace(filename, "/", "\\", -1)
|
2019-06-13 21:31:37 -05:00
|
|
|
return filename
|
|
|
|
}
|