forked from x/ContextOS
add app
This commit is contained in:
parent
5abcedfc02
commit
bfd0eeca25
6
Makefile
6
Makefile
@ -1,6 +1,6 @@
|
||||
export GOPROXY=https://goproxy.cn,direct
|
||||
export GOPRIVATE=shylinux.com,github.com
|
||||
export CGO_ENABLED=0
|
||||
# export CGO_ENABLED=0
|
||||
|
||||
all:
|
||||
@echo && date
|
||||
@ -14,3 +14,7 @@ all:
|
||||
ice:
|
||||
cat src/binpack.go|sed 's/package main/package ice/g' > usr/release/binpack.go
|
||||
|
||||
macapp:
|
||||
mkdir -p usr/publish/contexts.app/Contents/MacOS
|
||||
go build -o usr/publish/contexts.app/Contents/MacOS/contexts src/app.go src/binpack.go
|
||||
open usr/publish/contexts.app
|
||||
|
25
src/app.go
Normal file
25
src/app.go
Normal file
@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/webview/webview"
|
||||
"shylinux.com/x/ice"
|
||||
_ "shylinux.com/x/icebergs/misc/app"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Chdir(path.Join("/Users", os.Getenv("USER"), "contexts"))
|
||||
go ice.Run("serve", "start", "dev", "shy")
|
||||
time.Sleep(time.Second)
|
||||
|
||||
w := webview.New(true)
|
||||
defer w.Destroy()
|
||||
|
||||
w.SetTitle("contexts")
|
||||
w.SetSize(800, 600, webview.HintNone)
|
||||
w.Navigate("http://localhost:9020")
|
||||
w.Run()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user