Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 08ebb4f

Browse files
committedAug 7, 2015
dashp option for mkdir should not report error on already exists
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent 169c669 commit 08ebb4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎core/commands/mfs.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,10 @@ var MfsMkdirCmd = &cmds.Command{
778778

779779
_, err = cur.Mkdir(parts[len(parts)-1])
780780
if err != nil {
781-
res.SetError(err, cmds.ErrNormal)
782-
return
781+
if !dashp || err != os.ErrExist {
782+
res.SetError(err, cmds.ErrNormal)
783+
return
784+
}
783785
}
784786
},
785787
}

0 commit comments

Comments
 (0)
Please sign in to comment.