From 82c8f3a18b2df95813e7ff39cb20783b05204ec4 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 17 Jul 2022 22:28:21 +0800 Subject: [PATCH] opt some --- core/code/autogen.go | 21 +++++++++++++++------ core/code/js.go | 2 +- core/code/vimer.go | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/code/autogen.go b/core/code/autogen.go index 564df2ba..e14be17f 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -119,10 +119,10 @@ go 1.11 func _autogen_git(m *ice.Message, arg ...string) ice.Map { return kit.Dict("Path", kit.Path(""), "Time", m.Time(), arg, - "Hash", strings.TrimSpace(m.Cmdx(cli.SYSTEM, "git", "log", "-n1", `--pretty=%H`)), - "Remote", strings.TrimSpace(m.Cmdx(cli.SYSTEM, "git", "config", "remote.origin.url")), - "Branch", strings.TrimSpace(m.Cmdx(cli.SYSTEM, "git", "rev-parse", "--abbrev-ref", "HEAD")), - "Version", strings.TrimSpace(m.Cmdx(cli.SYSTEM, "git", "describe", "--tags")), + "Hash", strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, "log", "-n1", `--pretty=%H`)), + "Remote", strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, "config", "remote.origin.url")), + "Branch", strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, "rev-parse", "--abbrev-ref", "HEAD")), + "Version", strings.TrimSpace(m.Cmdx(cli.SYSTEM, GIT, "describe", "--tags")), "Domain", m.Option(ice.MSG_USERWEB), ) } @@ -136,8 +136,17 @@ func _autogen_gits(m *ice.Message, arg ...string) string { func _autogen_version(m *ice.Message) { if mod := _autogen_mod(m, ice.GO_MOD); !kit.FileExists(".git") { m.Cmdy(cli.SYSTEM, GIT, ice.INIT) - m.Cmdy(cli.SYSTEM, GIT, "remote", "add", "origin", "https://"+mod) - m.Cmd("web.code.git.repos", mdb.CREATE, "repos", "https://"+mod, "name", path.Base(mod), "path", "./") + m.Cmd(cli.SYSTEM, GIT, "remote", "add", "origin", "https://"+mod) + m.Cmd("web.code.git.repos", mdb.CREATE, "repos", "https://"+mod, mdb.NAME, path.Base(mod), nfs.PATH, nfs.PWD) + m.Cmd(cli.SYSTEM, GIT, "add", ice.GO_MOD, ice.SRC, ice.ETC_MISS_SH) + m.Cmd(nfs.DEFS, ".gitignore", kit.Format(`src/binpack.go +src/version.go +etc/ +bin/ +var/ +usr/ +.* +`)) } m.Cmd(nfs.DEFS, ice.SRC_BINPACK_GO, kit.Format(`package main diff --git a/core/code/js.go b/core/code/js.go index ae0c0260..179c505c 100644 --- a/core/code/js.go +++ b/core/code/js.go @@ -18,7 +18,7 @@ func _js_main_script(m *ice.Message, arg ...string) (res []string) { res = append(res, kit.Format(`require("%s")`, kit.Path("usr/volcanos/publish/client/nodejs/proto.js"))) } else { for _, file := range []string{"proto.js", "frame.js", "lib/base.js", "lib/core.js", "lib/misc.js", "lib/page.js", "publish/client/nodejs/proto.js"} { - res = append(res, `_can_name = "./`+file+`"`) + res = append(res, `_can_name = "`+kit.Path(ice.USR_VOLCANOS, file)+`"`) res = append(res, string(ice.Info.Pack[ice.PS+file])) } } diff --git a/core/code/vimer.go b/core/code/vimer.go index 294a61f6..5ad26867 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -31,7 +31,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg) { }}) `, nfs.ZML, ` -left +{ username 系统 命令 index cli.system @@ -45,7 +45,7 @@ left 数据 index hi/hi.py 后端 index hi/hi.go 前端 index hi/hi.js -main +} `, nfs.IML, ` 系统