diff --git a/base/cli/runtime.go b/base/cli/runtime.go index 679d6524..f4161418 100644 --- a/base/cli/runtime.go +++ b/base/cli/runtime.go @@ -277,8 +277,8 @@ func ParseMake(str string) []string { version := kit.Format(kit.Value(data, nfs.VERSION)) if kit.Format(kit.Value(data, "forword")) != "0" { version = kit.Join(kit.TrimArg(kit.Simple( - kit.Format(kit.Value(data, nfs.VERSION)), - kit.Format(kit.Value(data, "forword")), + kit.Select("v0.0.0", kit.Format(kit.Value(data, nfs.VERSION))), + kit.Select("0", kit.Format(kit.Value(data, "forword"))), kit.Cut(kit.Format(kit.Value(data, mdb.HASH)), 6), )...), "-") } diff --git a/base/web/dream.go b/base/web/dream.go index fb7c9b54..8a1fcde0 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -451,6 +451,8 @@ func init() { switch m.Option(mdb.TYPE) { case WORKER: list = append(list, "settings", tcp.SEND, OPEN) + case SERVER: + list = append(list, DREAM, OPEN) default: list = append(list, TOKEN, DREAM, OPEN) } diff --git a/core/code/autogen.go b/core/code/autogen.go index 9b3434df..4f0422d1 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -98,19 +98,18 @@ func _autogen_git(m *ice.Message, arg ...string) ice.Map { ) } func _autogen_mod(m *ice.Message, file string) (mod string) { - host := m.Cmdx(REPOS, REMOTE_URL) - if host != "" { - host = strings.Split(host, "://")[1] - if strings.Contains(host, ":") { - host = path.Base(host) - } - } else { - host = kit.ParseURL(kit.Select(m.Option(ice.MSG_USERHOST), ice.Info.Make.Remote)).Hostname() - if host == "" { + host := kit.Select(ice.Info.Make.Remote, m.Cmdx(REPOS, REMOTE_URL)) + if host == "" { + host = m.Option(ice.MSG_USERHOST) + if host == "" || !strings.HasPrefix(host, ice.HTTP) { host = path.Base(kit.Path("")) } else { + host = strings.Split(host, "://")[1] host = path.Join(host, "x", path.Base(kit.Path(""))) + kit.If(strings.Contains(host, ":"), func() { host = path.Base(host) }) } + } else { + host = strings.Split(host, "://")[1] } m.Cmd(nfs.DEFS, file, kit.Format(nfs.Template(m, ice.GO_MOD), host)) // ReposAddFile(m, "", ice.GO_MOD) diff --git a/core/code/publish.go b/core/code/publish.go index d3596349..944621f0 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -46,11 +46,9 @@ func _publish_file(m *ice.Message, file string, arg ...string) string { } func _publish_contexts(m *ice.Message, arg ...string) { // m.Options(nfs.DIR_ROOT, "") - m.Debug("what %v", m.Option(web.DREAM)) - m.Debug("what %v", m.Option(nfs.SOURCE)) m.OptionDefault(web.DOMAIN, tcp.PublishLocalhost(m, web.UserHost(m))) m.OptionDefault(cli.CTX_CLI, "temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL $ctx_dev; else wget -O $temp -q $ctx_dev; fi; source $temp") - m.OptionDefault(cli.CTX_ARG, kit.JoinCmds(aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.LANGUAGE, m.Option(ice.MSG_LANGUAGE))) + m.OptionDefault(cli.CTX_ARG, kit.JoinCmdArgs(aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.LANGUAGE, m.Option(ice.MSG_LANGUAGE))) for _, k := range kit.Default(arg, ice.MISC) { env := []string{} switch k {