Commit b61dae36 authored by Kejie Zhang's avatar Kejie Zhang

use file fullpath to judge file name

License: MIT
Signed-off-by: default avatarKejie Zhang <601172892@qq.com>
parent 19e3c127
......@@ -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 = ""
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment