Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
7cdf4c31
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7cdf4c31
编写于
1月 14, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v2.3.18 Fixed Chinese input and gtk3 issues for linux packagin
上级
e7ef4667
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
14 deletion
+29
-14
cef/homedir.go
cef/homedir.go
+4
-4
common/assetserve/server_test.go
common/assetserve/server_test.go
+1
-3
common/common.go
common/common.go
+24
-7
未找到文件。
cef/homedir.go
浏览文件 @
7cdf4c31
...
...
@@ -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
{
...
...
common/assetserve/server_test.go
浏览文件 @
7cdf4c31
...
...
@@ -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()
}
common/common.go
浏览文件 @
7cdf4c31
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录