1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

opt inner.js

This commit is contained in:
harveyshao 2023-01-26 13:26:43 +08:00
parent b31a217baf
commit 3625742900

View File

@ -2,6 +2,7 @@ package log
import (
"strings"
"unicode"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
@ -27,8 +28,6 @@ func init() {
ls := strings.SplitN(line, ice.SP, 6)
m.Push(mdb.TIME, ls[0]+ice.SP+ls[1])
m.Push(mdb.ID, ls[2])
m.Push("ship", ls[3])
i := strings.LastIndex(ls[5], ice.SP)
if strings.HasPrefix(ls[5][i+1:], "base") || strings.HasPrefix(ls[5][i+1:], "core") || strings.HasPrefix(ls[5][i+1:], "misc") {
m.Push(nfs.PATH, ice.USR_ICEBERGS)
@ -45,6 +44,17 @@ func init() {
m.Push(nfs.FILE, "init.go")
m.Push(nfs.LINE, "90")
}
if ls[4] == "cmds" {
_ls := strings.SplitN(ls[5], ice.SP, 2)
ls[4] = _ls[0]
ls[5] = _ls[1]
if !unicode.IsDigit(rune(ls[5][0])) {
_ls := strings.SplitN(ls[5], ice.SP, 2)
ls[4] += ice.SP + _ls[0]
ls[5] = _ls[1]
}
}
m.Push("ship", ls[3])
m.Push(ctx.ACTION, ls[4])
m.Push(mdb.TEXT, ls[5])
})