mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-05 08:18:03 +08:00
use file fullpath to judge file name
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
This commit is contained in:
parent
19e3c127ee
commit
b61dae36f3
@ -117,7 +117,7 @@ You can now check what blocks have been created by:
|
||||
cmdkit.BoolOption(trickleOptionName, "t", "Use trickle-dag format for dag generation."),
|
||||
cmdkit.BoolOption(onlyHashOptionName, "n", "Only chunk and hash - do not write to disk."),
|
||||
cmdkit.BoolOption(wrapOptionName, "w", "Wrap files with a directory object."),
|
||||
cmdkit.StringOption(pathName, "Assign path name when use wrap-with-directory option"),
|
||||
cmdkit.StringOption(pathName, "Assign a name if the file source is stdin."),
|
||||
cmdkit.BoolOption(hiddenOptionName, "H", "Include files that are hidden. Only takes effect on recursive add."),
|
||||
cmdkit.StringOption(chunkerOptionName, "s", "Chunking algorithm, size-[bytes] or rabin-[min]-[avg]-[max]").WithDefault("size-262144"),
|
||||
cmdkit.BoolOption(pinOptionName, "Pin this object when adding.").WithDefault(true),
|
||||
|
||||
@ -472,7 +472,7 @@ func (adder *Adder) addFile(file files.File) error {
|
||||
}
|
||||
|
||||
addFileName := file.FileName()
|
||||
if addFileName == "" && adder.Name != "" {
|
||||
if (file.FullPath() == "/dev/stdin" || file.FullPath() == "") && adder.Name != "" {
|
||||
addFileName = adder.Name
|
||||
adder.Name = ""
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user