add a path wrapper for Windows
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
621be7d20a
commit
9648439950
|
@ -1,10 +1,19 @@
|
|||
package shell
|
||||
|
||||
import "runtime"
|
||||
import "strings"
|
||||
|
||||
func Execname(filename string) string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return filename + ".exe"
|
||||
if runtime.GOOS != "windows" {
|
||||
return filename
|
||||
}
|
||||
return Path(filename) + ".exe"
|
||||
}
|
||||
|
||||
func Path(filename string) string {
|
||||
if runtime.GOOS != "windows" {
|
||||
return filename
|
||||
}
|
||||
filename = strings.Replace(filename, "/", "\\", -1)
|
||||
return filename
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue