Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
a6eb32b7
提交
a6eb32b7
authored
11月 02, 2015
作者:
Dominic Della Valle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix path parsing for add command
License: MIT Signed-off-by:
Dominic Della Valle
<
ddvpublic@gmail.com
>
上级
fb8189d6
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
7 行删除
+8
-7
parse.go
commands/cli/parse.go
+2
-1
serialfile.go
commands/files/serialfile.go
+4
-4
add.go
core/commands/add.go
+1
-1
gateway_handler.go
core/corehttp/gateway_handler.go
+1
-1
没有找到文件。
commands/cli/parse.go
浏览文件 @
a6eb32b7
...
...
@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path"
"path/filepath"
"runtime"
"strings"
...
...
@@ -364,7 +365,7 @@ func appendStdinAsString(args []string, stdin *os.File) ([]string, *os.File, err
}
func
appendFile
(
args
[]
files
.
File
,
inputs
[]
string
,
argDef
*
cmds
.
Argument
,
recursive
bool
)
([]
files
.
File
,
[]
string
,
error
)
{
fpath
:=
inputs
[
0
]
fpath
:=
filepath
.
ToSlash
(
filepath
.
Clean
(
inputs
[
0
]))
if
fpath
==
"."
{
cwd
,
err
:=
os
.
Getwd
()
...
...
commands/files/serialfile.go
浏览文件 @
a6eb32b7
...
...
@@ -5,7 +5,7 @@ import (
"io"
"io/ioutil"
"os"
fp
"path/filepath"
"path/filepath"
"syscall"
)
...
...
@@ -69,8 +69,8 @@ func (f *serialFile) NextFile() (File, error) {
f
.
files
=
f
.
files
[
1
:
]
// open the next file
fileName
:=
f
p
.
Join
(
f
.
name
,
stat
.
Name
(
))
filePath
:=
f
p
.
Join
(
f
.
path
,
stat
.
Name
(
))
fileName
:=
f
ilepath
.
ToSlash
(
filepath
.
Join
(
f
.
name
,
stat
.
Name
()
))
filePath
:=
f
ilepath
.
ToSlash
(
filepath
.
Join
(
f
.
path
,
stat
.
Name
()
))
// recursively call the constructor on the next file
// if it's a regular file, we will open it as a ReaderFile
...
...
@@ -120,7 +120,7 @@ func (f *serialFile) Size() (int64, error) {
}
var
du
int64
err
:=
f
p
.
Walk
(
f
.
FileName
(),
func
(
p
string
,
fi
os
.
FileInfo
,
err
error
)
error
{
err
:=
f
ilepath
.
Walk
(
f
.
FileName
(),
func
(
p
string
,
fi
os
.
FileInfo
,
err
error
)
error
{
if
fi
!=
nil
&&
fi
.
Mode
()
&
(
os
.
ModeSymlink
|
os
.
ModeNamedPipe
)
==
0
{
du
+=
fi
.
Size
()
}
...
...
core/commands/add.go
浏览文件 @
a6eb32b7
...
...
@@ -446,7 +446,7 @@ func (params *adder) addDir(file files.File) (*dag.Node, error) {
}
if
node
!=
nil
{
_
,
name
:=
path
.
Split
(
file
.
FileName
())
name
:=
path
.
Base
(
file
.
FileName
())
err
=
tree
.
AddNodeLink
(
name
,
node
)
if
err
!=
nil
{
...
...
core/corehttp/gateway_handler.go
浏览文件 @
a6eb32b7
...
...
@@ -174,7 +174,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
if
err
==
nil
{
defer
dr
.
Close
()
_
,
name
:=
gopath
.
Split
(
urlPath
)
name
:=
gopath
.
Base
(
urlPath
)
http
.
ServeContent
(
w
,
r
,
name
,
modtime
,
dr
)
return
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论