1
0
forked from x/ContextOS
This commit is contained in:
harveyshao 2022-10-15 11:46:12 +08:00
parent 23967d62f3
commit 1f6b4942dd
3 changed files with 15 additions and 7 deletions

View File

@ -13,7 +13,7 @@ def:
@ [ -f src/binpack.go ] || echo "package main" > src/binpack.go @ [ -f src/binpack.go ] || echo "package main" > src/binpack.go
app: def app: def
CGO_ENABLED=1 go build -v -o usr/publish/contexts.app/Contents/MacOS/contexts src/webview.go src/version.go src/binpack.go && ./${binarys} forever stop && sleep 1 && open usr/publish/contexts.app CGO_ENABLED=1 go build -v -o usr/publish/contexts.app/Contents/MacOS/contexts src/webview.go src/version.go src/binpack.go && ./${binarys} forever restart &>/dev/null
# hdiutil create usr/publish/tmp.dmg -ov -volname "ContextsInstall" -fs HFS+ -srcfolder "usr/publish/contexts.app" # hdiutil create usr/publish/tmp.dmg -ov -volname "ContextsInstall" -fs HFS+ -srcfolder "usr/publish/contexts.app"
# rm -f usr/publish/ContextsInstall.dmg # rm -f usr/publish/ContextsInstall.dmg
# hdiutil convert usr/publish/tmp.dmg -format UDZO -o usr/publish/ContextsInstall.dmg # hdiutil convert usr/publish/tmp.dmg -format UDZO -o usr/publish/ContextsInstall.dmg

View File

@ -5,6 +5,7 @@ import (
"time" "time"
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/tcp" "shylinux.com/x/icebergs/base/tcp"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
"shylinux.com/x/icebergs/misc/webview" "shylinux.com/x/icebergs/misc/webview"
@ -14,8 +15,15 @@ import (
type view struct{ *webview.WebView } type view struct{ *webview.WebView }
func main() { func main() {
os.Chdir(kit.HomePath(ice.CONTEXTS)) if os.Chdir(kit.HomePath(ice.CONTEXTS)); len(os.Args) == 1 {
for {
if ice.Run(cli.SYSTEM, os.Args[0], "webview"); cli.IsSuccess(ice.Pulse) {
break
}
}
} else {
go ice.Run(web.SERVE, tcp.START) go ice.Run(web.SERVE, tcp.START)
time.Sleep(time.Second) time.Sleep(time.Second)
webview.Run(func(w *webview.WebView) ice.Any { return view{w} }) webview.Run(func(w *webview.WebView) ice.Any { return view{w} })
} }
}

View File

@ -1,3 +1,3 @@
localhost http://localhost:9020
shylinux https://shylinux.com shylinux https://shylinux.com
vimer "http://localhost:9020/chat/cmd/web.code.vimer?topic=black&path=src/,usr/icebergs/,usr/volcanos/&file=main.go#src/,main.go,1" localhost http://localhost:9020
vimer "http://localhost:9020/chat/cmd/web.code.vimer?topic=black&path=src/,usr/icebergs/,usr/volcanos/&file=main.go"