From 92bc2186ce7c0975044c23d4f9ed71b89d7c709a Mon Sep 17 00:00:00 2001 From: shylinux Date: Thu, 9 Mar 2023 11:40:25 +0800 Subject: [PATCH] opt code --- src/main.go | 4 - src/main.sh | 1 + src/main.shy | 3 - src/template/web.code.publish/base.sh | 2 + src/template/web.code.publish/core.sh | 2 + src/template/web.code.publish/misc.sh | 1 + usr/local/export/web.chat.favor/hash.json | 116 ++++------------------ 7 files changed, 26 insertions(+), 103 deletions(-) create mode 100644 src/template/web.code.publish/base.sh create mode 100644 src/template/web.code.publish/core.sh create mode 100644 src/template/web.code.publish/misc.sh diff --git a/src/main.go b/src/main.go index cc658d4f..9c47c69a 100644 --- a/src/main.go +++ b/src/main.go @@ -45,10 +45,6 @@ import ( _ "shylinux.com/x/golang-story/src/prometheus" _ "shylinux.com/x/contexts/src/hi" - - _ "shylinux.com/x/contexts/src/h2" - - _ "shylinux.com/x/contexts/src/h3" ) func main() { print(ice.Run()) } diff --git a/src/main.sh b/src/main.sh index e487e4bf..1bf21df0 100644 --- a/src/main.sh +++ b/src/main.sh @@ -5,6 +5,7 @@ main() { case "$1" in app) # 生产环境 + export PATH="$PWD/bin:$PWD/local/bin:$PWD/usr/local/go/bin:$PATH" shift && prepare_ice && while true; do bin/ice.bin serve start dev dev "$@" && break done diff --git a/src/main.shy b/src/main.shy index a396624e..a77da31a 100644 --- a/src/main.shy +++ b/src/main.shy @@ -63,6 +63,3 @@ field "趋势图" web.code.git.trend args `intshell` field "架构图" web.code.git.spide args `intshell` spark md README.md -source h2/h2.shy -source h2/h2.shy -source h3/h3.shy diff --git a/src/template/web.code.publish/base.sh b/src/template/web.code.publish/base.sh new file mode 100644 index 00000000..02431215 --- /dev/null +++ b/src/template/web.code.publish/base.sh @@ -0,0 +1,2 @@ +temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL {{.Option "domain"}}; else wget -O $temp -q {{.Option "domain"}}; fi; source $temp source + diff --git a/src/template/web.code.publish/core.sh b/src/template/web.code.publish/core.sh new file mode 100644 index 00000000..0f370e55 --- /dev/null +++ b/src/template/web.code.publish/core.sh @@ -0,0 +1,2 @@ +temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL {{.Option "domain"}}; else wget -O $temp -q {{.Option "domain"}}; fi; source $temp binary + diff --git a/src/template/web.code.publish/misc.sh b/src/template/web.code.publish/misc.sh new file mode 100644 index 00000000..b000c94d --- /dev/null +++ b/src/template/web.code.publish/misc.sh @@ -0,0 +1 @@ +export ctx_dev={{.Option "domain"}}{{.Option "ctx_env"}}; temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL $ctx_dev; else wget -O $temp -q $ctx_dev; fi; source $temp app username {{.Option "user.name"}} usernick "{{.Option "user.nick"}}" diff --git a/usr/local/export/web.chat.favor/hash.json b/usr/local/export/web.chat.favor/hash.json index d3b45896..42897619 100644 --- a/usr/local/export/web.chat.favor/hash.json +++ b/usr/local/export/web.chat.favor/hash.json @@ -1,103 +1,19 @@ { - "1a9dcf": { + "2f1cbf": { "meta": { - "name": "192.168.8.145:9020", - "text": "http://192.168.8.145:9020/?debug=true", - "time": "2023-03-01 11:24:27", - "type": "link" + "name": "1dfda3cc2922a90350bb3c99b66d6d83.jpg", + "text": "var/file/1d/1dfda3cc2922a90350bb3c99b66d6d83", + "time": "2023-03-09 10:03:36", + "type": "image/jpeg" } }, - "284e68": { + "5b7953": { "meta": { - "name": "192.168.8.145:9020", - "text": "http://192.168.8.145:9020/chat/cmd/web.code.vimer?debug=true", - "time": "2023-03-01 11:22:15", - "type": "link" - } - }, - "2b0c19": { - "meta": { - "name": "alpine", - "text": "docker run -w /root -e 'LC_ALL=en_US.UTF-8' -it alpine", - "time": "2023-03-04 12:39:07", - "type": "shell" - } - }, - "3d8fb3": { - "meta": { - "name": "192.168.8.1", - "text": "http://192.168.8.1", - "time": "2023-03-01 11:23:10", - "type": "link" - } - }, - "4ee328": { - "meta": { - "text": "Docker.app", - "time": "2023-03-04 18:16:41", - "type": "_open" - } - }, - "512cfd": { - "meta": { - "text": "Google Chrome.app", - "time": "2023-03-04 18:09:53", - "type": "_open" - } - }, - "65cc8f": { - "meta": { - "name": "192.168.10.1", - "text": "http://192.168.10.1", - "time": "2023-03-01 12:06:48", - "type": "link" - } - }, - "723b5b": { - "meta": { - "name": "busybox", - "text": "docker run -w /root -it busybox", - "time": "2023-03-04 12:34:00", - "type": "shell" - } - }, - "76103b": { - "meta": { - "text": "Terminal.app", - "time": "2023-03-04 18:09:35", - "type": "_open" - } - }, - "8a5ce7": { - "meta": { - "text": "ice.bin space dial dev ops", - "time": "2023-03-06 20:27:03", - "type": "shell" - } - }, - "937f9e": { - "meta": { - "name": "contexts.com.cn", - "text": "https://contexts.com.cn", - "time": "2023-03-04 15:25:59", - "type": "link" - } - }, - "acf002": { - "meta": { - "text": "src/h2/h2.sh", - "time": "2023-03-04 13:07:07", + "text": "src/main.go", + "time": "2023-03-09 08:41:49", "type": "file" } }, - "c1220f": { - "meta": { - "name": "shylinux.com", - "text": "https://shylinux.com", - "time": "2023-03-04 15:25:45", - "type": "link" - } - }, "c67e09": { "meta": { "text": "ssh root@192.168.8.1", @@ -105,6 +21,13 @@ "type": "shell" } }, + "c94cf6": { + "meta": { + "text": "web.code.vimer", + "time": "2023-03-09 08:42:00", + "type": "index" + } + }, "cdbecd": { "meta": { "text": "ssh shy@shylinux.com", @@ -112,11 +35,12 @@ "type": "shell" } }, - "dd37a4": { + "de83eb": { "meta": { - "text": "Safari.app", - "time": "2023-03-04 18:20:18", - "type": "_open" + "name": "shot.png", + "text": "var/file/14/145a577d5a823fe6699dd8946d9ab787", + "time": "2023-03-09 09:58:07", + "type": "image/png" } } }