mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-04 10:02:15 +00:00
23 lines
398 B
Go
23 lines
398 B
Go
package toolinstall
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
func executableName(name string) string {
|
|
if runtime.GOOS == "windows" && !strings.EqualFold(filepath.Ext(name), ".exe") {
|
|
return name + ".exe"
|
|
}
|
|
return name
|
|
}
|
|
|
|
func isExecutable(info os.FileInfo) bool {
|
|
if !info.Mode().IsRegular() {
|
|
return false
|
|
}
|
|
return runtime.GOOS == "windows" || info.Mode()&0o111 != 0
|
|
}
|