1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-02-28 21:53:10 +08:00
parent f95632b30a
commit f5573b92f1

View File

@ -113,24 +113,18 @@ func _system_code(cmd *exec.Cmd) string {
return kit.Select("1", "0", cmd.ProcessState != nil && cmd.ProcessState.Success())
}
func _system_find(m Message, bin string, dir ...string) string {
ice.Pulse.Debug("what %v %v", bin, dir)
if strings.Contains(bin, ice.DF) {
ice.Pulse.Debug("what %v %v", bin, dir)
return bin
}
if strings.HasPrefix(bin, ice.PS) {
ice.Pulse.Debug("what %v %v", bin, dir)
return bin
}
if strings.HasPrefix(bin, nfs.PWD) {
ice.Pulse.Debug("what %v %v", bin, dir)
return bin
}
if len(dir) == 0 {
ice.Pulse.Debug("what %v %v", bin, dir)
dir = append(dir, _path_split(kit.Env(PATH))...)
}
ice.Pulse.Debug("what %v %v", bin, dir)
for _, p := range dir {
if nfs.ExistsFile(m, path.Join(p, bin)) {
return kit.Path(p, bin)