Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0d9a8207
Commit
0d9a8207
authored
Nov 18, 2016
by
Aron Fischer
Committed by
Felix Lange
Nov 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/bzzup: trim directory in the manifest entry path (#3299)
parent
04edbb07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
main.go
cmd/bzzup/main.go
+2
-2
No files found.
cmd/bzzup/main.go
View file @
0d9a8207
...
...
@@ -106,7 +106,7 @@ func (c *client) uploadFile(file string, fi os.FileInfo) (manifest, error) {
func
(
c
*
client
)
uploadDirectory
(
dir
string
)
(
manifest
,
error
)
{
dirm
:=
manifest
{}
prefix
:=
filepath
.
ToSlash
(
dir
)
+
"/"
prefix
:=
filepath
.
ToSlash
(
filepath
.
Clean
(
dir
)
)
+
"/"
err
:=
filepath
.
Walk
(
dir
,
func
(
path
string
,
fi
os
.
FileInfo
,
err
error
)
error
{
if
err
!=
nil
||
fi
.
IsDir
()
{
return
err
...
...
@@ -115,7 +115,7 @@ func (c *client) uploadDirectory(dir string) (manifest, error) {
return
fmt
.
Errorf
(
"path %s outside directory %s"
,
path
,
dir
)
}
entry
,
err
:=
c
.
uploadFile
(
path
,
fi
)
entry
.
Path
=
strings
.
TrimPrefix
(
filepath
.
ToSlash
(
path
),
prefix
)
entry
.
Path
=
strings
.
TrimPrefix
(
filepath
.
ToSlash
(
filepath
.
Clean
(
path
)
),
prefix
)
dirm
.
Entries
=
append
(
dirm
.
Entries
,
entry
)
return
err
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment