forked from x/icebergs
add some
This commit is contained in:
parent
0d84e0c9ad
commit
3ef850c581
@ -56,10 +56,12 @@ func Render(m *ice.Message, cmd string, args ...ice.Any) bool {
|
|||||||
case COOKIE: // value [name [path [expire]]]
|
case COOKIE: // value [name [path [expire]]]
|
||||||
RenderCookie(m, arg[0], arg[1:]...)
|
RenderCookie(m, arg[0], arg[1:]...)
|
||||||
case STATUS, ice.RENDER_STATUS: // [code [text]]
|
case STATUS, ice.RENDER_STATUS: // [code [text]]
|
||||||
// RenderStatus(m.W, kit.Int(kit.Select("200", arg, 0)), m.FormatsMeta(nil))
|
if m.IsCliUA() {
|
||||||
|
RenderStatus(m.W, kit.Int(kit.Select("200", arg, 0)), kit.Select(m.Result(), strings.Join(kit.Slice(arg, 1), " ")))
|
||||||
|
} else {
|
||||||
m.W.WriteHeader(kit.Int(kit.Select("200", arg, 0)))
|
m.W.WriteHeader(kit.Int(kit.Select("200", arg, 0)))
|
||||||
renderMsg(m)
|
renderMsg(m)
|
||||||
// RenderStatus(m.W, kit.Int(kit.Select("200", arg, 0)), kit.Select(m.Result(), strings.Join(kit.Slice(arg, 1), " ")))
|
}
|
||||||
case ice.RENDER_REDIRECT: // url [arg...]
|
case ice.RENDER_REDIRECT: // url [arg...]
|
||||||
http.Redirect(m.W, m.R, m.MergeLink(arg[0], arg[1:]), http.StatusTemporaryRedirect)
|
http.Redirect(m.W, m.R, m.MergeLink(arg[0], arg[1:]), http.StatusTemporaryRedirect)
|
||||||
case ice.RENDER_DOWNLOAD: // file [type [name]]
|
case ice.RENDER_DOWNLOAD: // file [type [name]]
|
||||||
|
@ -40,12 +40,11 @@ func _autogen_module(m *ice.Message, file string) {
|
|||||||
ReposAddFile(m, "", file)
|
ReposAddFile(m, "", file)
|
||||||
}
|
}
|
||||||
func _autogen_defs(m *ice.Message, arg ...string) {
|
func _autogen_defs(m *ice.Message, arg ...string) {
|
||||||
kit.For(arg, func(p string) {
|
kit.For(arg, func(p string) { m.Cmd(nfs.DEFS, p, m.Cmdx(nfs.CAT, p)); ReposAddFile(m, "", p) })
|
||||||
m.Cmd(nfs.DEFS, p, m.Cmdx(nfs.CAT, p))
|
|
||||||
ReposAddFile(m, "", p)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
func _autogen_import(m *ice.Message, main string, ctx string, mod string) {
|
func _autogen_import(m *ice.Message, main string, ctx string, mod string) {
|
||||||
|
m.Cmd(nfs.DEFS, ice.ETC_MISS_SH, m.Template("miss.sh"))
|
||||||
|
_autogen_defs(m, ice.README_MD, ice.MAKEFILE, ice.LICENSE)
|
||||||
_autogen_defs(m, ice.SRC_MAIN_GO, ice.ETC_MISS_SH, ice.README_MD, ice.MAKEFILE, ice.LICENSE)
|
_autogen_defs(m, ice.SRC_MAIN_GO, ice.ETC_MISS_SH, ice.README_MD, ice.MAKEFILE, ice.LICENSE)
|
||||||
begin, done, list := false, false, []string{}
|
begin, done, list := false, false, []string{}
|
||||||
m.Cmd(nfs.CAT, main, func(line string, index int) {
|
m.Cmd(nfs.CAT, main, func(line string, index int) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user