From 5bc53aa9f0027d9b4e51dfd18ef098c6d0de9c28 Mon Sep 17 00:00:00 2001 From: shaoying Date: Thu, 8 Oct 2020 07:58:45 +0800 Subject: [PATCH] opt some --- Makefile | 3 ++- src/main.go | 14 ++++++++++++++ src/main.shy | 30 ++++++++++++++++++------------ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index a4e7c26c..0738d3b2 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ export GOPROXY=https://goproxy.cn export GOPRIVATE=github.com # export CGO_ENABLED=0 +meta_info = "-X main.Time=`date +"%Y-%m-%d_%H:%M:%S"` -X main.Version=`git describe --tags` -X main.HostName=`hostname` -X main.UserName=`whoami`" all: @echo && date - go build -v -o bin/ice.bin src/main.go && chmod u+x bin/ice.bin && ./bin/ice.sh restart + go build -ldflags $(meta_info) -v -o bin/ice.bin src/main.go && chmod u+x bin/ice.bin && ./bin/ice.sh restart diff --git a/src/main.go b/src/main.go index bf95e7e6..c7f92c79 100644 --- a/src/main.go +++ b/src/main.go @@ -37,4 +37,18 @@ import ( _ "github.com/shylinux/mysql-story/src/server" ) +var ( + Time string + Version string + HostName string + UserName string +) + +func init() { + ice.Info.Build.Time = Time + ice.Info.Build.Version = Version + ice.Info.Build.HostName = HostName + ice.Info.Build.UserName = UserName +} + func main() { print(ice.Run()) } diff --git a/src/main.shy b/src/main.shy index 5a50237d..90310bd3 100644 --- a/src/main.shy +++ b/src/main.shy @@ -1,9 +1,3 @@ -source ../usr/icebergs/base/gdb/gdb.shy -source ../usr/icebergs/base/tcp/tcp.shy -source ../usr/icebergs/base/nfs/nfs.shy -source ../usr/icebergs/base/ssh/ssh.shy -source ../usr/icebergs/base/mdb/mdb.shy -return title "contexts" premenu @@ -26,12 +20,6 @@ volcanos icebergs intshell learning toolkits contexts ` stroke red fill black -chapter "群组" -field "群组" web.chat.river -field "粘贴板" web.chat.paste -field "二维码" web.chat.qrcode -field "地理位置" web.chat.location - chapter "代码" field "收藏夹" web.code.favor field "生成器" web.code.autogen @@ -40,6 +28,24 @@ field "火山架" web.code.git.trend args `volcanos` field "冰山架" web.code.git.trend args `icebergs` field "冰山架" web.code.git.spide args `usr/icebergs` + +source ../usr/icebergs/base/ctx/ctx.shy +source ../usr/icebergs/base/cli/cli.shy +source ../usr/icebergs/base/aaa/aaa.shy +source ../usr/icebergs/base/web/web.shy +source ../usr/icebergs/base/gdb/gdb.shy +source ../usr/icebergs/base/log/log.shy +source ../usr/icebergs/base/tcp/tcp.shy +source ../usr/icebergs/base/nfs/nfs.shy +source ../usr/icebergs/base/ssh/ssh.shy +source ../usr/icebergs/base/mdb/mdb.shy + +chapter "群组" +field "群组" web.chat.river +field "粘贴板" web.chat.paste +field "二维码" web.chat.qrcode +field "地理位置" web.chat.location + chapter "环境" field "安装管理" web.code.install field "发布管理" web.code.publish