Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
f455c8ba
Unverified
提交
f455c8ba
authored
8月 28, 2019
作者:
Steven Allen
提交者:
GitHub
8月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6609 from ipfs/fix/6022
version: don't print 'VERSION-' if no commit is specified
上级
32d54a0a
f6f8d685
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
10 行删除
+19
-10
daemon.go
cmd/ipfs/daemon.go
+5
-1
version.go
core/commands/version.go
+12
-8
core.go
core/core.go
+2
-1
没有找到文件。
cmd/ipfs/daemon.go
浏览文件 @
f455c8ba
...
...
@@ -726,7 +726,11 @@ func YesNoPrompt(prompt string) bool {
}
func
printVersion
()
{
fmt
.
Printf
(
"go-ipfs version: %s-%s
\n
"
,
version
.
CurrentVersionNumber
,
version
.
CurrentCommit
)
v
:=
version
.
CurrentVersionNumber
if
version
.
CurrentCommit
!=
""
{
v
+=
"-"
+
version
.
CurrentCommit
}
fmt
.
Printf
(
"go-ipfs version: %s
\n
"
,
v
)
fmt
.
Printf
(
"Repo version: %d
\n
"
,
fsrepo
.
RepoVersion
)
fmt
.
Printf
(
"System version: %s
\n
"
,
runtime
.
GOARCH
+
"/"
+
runtime
.
GOOS
)
fmt
.
Printf
(
"Golang version: %s
\n
"
,
runtime
.
Version
())
...
...
core/commands/version.go
浏览文件 @
f455c8ba
...
...
@@ -54,21 +54,25 @@ var VersionCmd = &cmds.Command{
},
Encoders
:
cmds
.
EncoderMap
{
cmds
.
Text
:
cmds
.
MakeTypedEncoder
(
func
(
req
*
cmds
.
Request
,
w
io
.
Writer
,
version
*
VersionOutput
)
error
{
commit
,
_
:=
req
.
Options
[
versionCommitOptionName
]
.
(
bool
)
commitTxt
:=
""
if
commit
{
commitTxt
=
"-"
+
version
.
Commit
}
all
,
_
:=
req
.
Options
[
versionAllOptionName
]
.
(
bool
)
if
all
{
out
:=
fmt
.
Sprintf
(
"go-ipfs version: %s-%s
\n
"
+
ver
:=
version
.
Version
if
version
.
Commit
!=
""
{
ver
+=
"-"
+
version
.
Commit
}
out
:=
fmt
.
Sprintf
(
"go-ipfs version: %s
\n
"
+
"Repo version: %s
\n
System version: %s
\n
Golang version: %s
\n
"
,
ver
sion
.
Version
,
version
.
Commit
,
version
.
Repo
,
version
.
System
,
version
.
Golang
)
ver
,
version
.
Repo
,
version
.
System
,
version
.
Golang
)
fmt
.
Fprint
(
w
,
out
)
return
nil
}
commit
,
_
:=
req
.
Options
[
versionCommitOptionName
]
.
(
bool
)
commitTxt
:=
""
if
commit
&&
version
.
Commit
!=
""
{
commitTxt
=
"-"
+
version
.
Commit
}
repo
,
_
:=
req
.
Options
[
versionRepoOptionName
]
.
(
bool
)
if
repo
{
fmt
.
Fprintln
(
w
,
version
.
Repo
)
...
...
core/core.go
浏览文件 @
f455c8ba
...
...
@@ -12,6 +12,7 @@ package core
import
(
"context"
"io"
"path"
"github.com/ipfs/go-filestore"
version
"github.com/ipfs/go-ipfs"
...
...
@@ -54,7 +55,7 @@ import (
var
log
=
logging
.
Logger
(
"core"
)
func
init
()
{
identify
.
ClientVersion
=
"go-ipfs/"
+
version
.
CurrentVersionNumber
+
"/"
+
version
.
CurrentCommit
identify
.
ClientVersion
=
path
.
Join
(
"go-ipfs"
,
version
.
CurrentVersionNumber
,
version
.
CurrentCommit
)
}
// IpfsNode is IPFS Core module. It represents an IPFS instance.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论