mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
f95632b30a
commit
f5573b92f1
@ -113,24 +113,18 @@ func _system_code(cmd *exec.Cmd) string {
|
|||||||
return kit.Select("1", "0", cmd.ProcessState != nil && cmd.ProcessState.Success())
|
return kit.Select("1", "0", cmd.ProcessState != nil && cmd.ProcessState.Success())
|
||||||
}
|
}
|
||||||
func _system_find(m Message, bin string, dir ...string) string {
|
func _system_find(m Message, bin string, dir ...string) string {
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
if strings.Contains(bin, ice.DF) {
|
if strings.Contains(bin, ice.DF) {
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
return bin
|
return bin
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(bin, ice.PS) {
|
if strings.HasPrefix(bin, ice.PS) {
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
return bin
|
return bin
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(bin, nfs.PWD) {
|
if strings.HasPrefix(bin, nfs.PWD) {
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
return bin
|
return bin
|
||||||
}
|
}
|
||||||
if len(dir) == 0 {
|
if len(dir) == 0 {
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
dir = append(dir, _path_split(kit.Env(PATH))...)
|
dir = append(dir, _path_split(kit.Env(PATH))...)
|
||||||
}
|
}
|
||||||
ice.Pulse.Debug("what %v %v", bin, dir)
|
|
||||||
for _, p := range dir {
|
for _, p := range dir {
|
||||||
if nfs.ExistsFile(m, path.Join(p, bin)) {
|
if nfs.ExistsFile(m, path.Join(p, bin)) {
|
||||||
return kit.Path(p, bin)
|
return kit.Path(p, bin)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user