提交 7cdf4c31 编写于 作者: yanghye's avatar yanghye

v2.3.18 Fixed Chinese input and gtk3 issues for linux packagin

上级 e7ef4667
......@@ -11,10 +11,10 @@ package cef
import (
"bytes"
"errors"
"github.com/energye/energy/common"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
......@@ -46,7 +46,7 @@ func Dir() (string, error) {
var result string
var err error
if runtime.GOOS == "windows" {
if common.IsWindows() {
result, err = dirWindows()
} else {
// Unix-like system, so just assume Unix
......@@ -96,7 +96,7 @@ func Reset() {
func dirUnix() (string, error) {
homeEnv := "HOME"
if runtime.GOOS == "plan9" {
if common.IsPlan9() {
// On plan9, env vars are lowercase.
homeEnv = "home"
}
......@@ -109,7 +109,7 @@ func dirUnix() (string, error) {
var stdout bytes.Buffer
// If that fails, try OS specific commands
if runtime.GOOS == "darwin" {
if common.IsDarwin() {
cmd := exec.Command("sh", "-c", `dscl -q . -read /Users/"$(whoami)" NFSHomeDirectory | sed 's/^[^ ]*: //'`)
cmd.Stdout = &stdout
if err := cmd.Run(); err == nil {
......
......@@ -2,7 +2,6 @@ package assetserve
import (
"embed"
"fmt"
"testing"
)
......@@ -13,6 +12,5 @@ func TestServer(t *testing.T) {
server := NewAssetsHttpServer()
server.AssetsFSName = "assets" //必须设置目录名
server.Assets = &assets
err := server.StartHttpServer()
fmt.Println(err)
server.StartHttpServer() //go server.StartHttpServer()
}
......@@ -27,13 +27,26 @@ import (
)
const (
IntSize = strconv.IntSize
IntSize32 = 32
intSize64 = 64
isWindows = runtime.GOOS == "windows"
isLinux = runtime.GOOS == "linux"
isDarwin = runtime.GOOS == "darwin"
IntSize = strconv.IntSize //bit
IntSize32 = 32 //
intSize64 = 64 //
isWindows = runtime.GOOS == "windows" //support
isLinux = runtime.GOOS == "linux" //support
isDarwin = runtime.GOOS == "darwin" //support
isAndroid = runtime.GOOS == "android" //not support
isIos = runtime.GOOS == "ios" //not support
isPlan9 = runtime.GOOS == "plan9" //not support
isAix = runtime.GOOS == "aix" //not support
isDragonfly = runtime.GOOS == "dragonfly" //not support
isFreebsd = runtime.GOOS == "freebsd" //not support
isHurd = runtime.GOOS == "hurd" //not support
isIllumos = runtime.GOOS == "illumos" //not support
isJs = runtime.GOOS == "js" //not support
isNacl = runtime.GOOS == "nacl" //not support
isNetbsd = runtime.GOOS == "netbsd" //not support
isOpenbsd = runtime.GOOS == "openbsd" //not support
isSolaris = runtime.GOOS == "solaris" //not support
isZos = runtime.GOOS == "zos" //not support
)
func Proc(index int) dllimports.ProcAddr {
......@@ -52,6 +65,10 @@ func IsDarwin() bool {
return isDarwin
}
func IsPlan9() bool {
return isPlan9
}
func StrToInt64(value string) int64 {
v, _ := strconv.ParseInt(value, 10, 64)
return v
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册