From 0a790a1a2e5625904651ffa1b946c8371e36f43b Mon Sep 17 00:00:00 2001 From: poornas Date: Thu, 21 Mar 2019 19:19:11 -0700 Subject: [PATCH] ls: consistent output while listing directories on file system (#2723) --- cmd/ls.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/ls.go b/cmd/ls.go index 67d435b4..eec7a587 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/dustin/go-humanize" + humanize "github.com/dustin/go-humanize" json "github.com/minio/mc/pkg/colorjson" "github.com/minio/mc/pkg/console" "github.com/minio/mc/pkg/probe" @@ -140,6 +140,8 @@ func doList(clnt Client, isRecursive, isIncomplete bool) error { contentURL := filepath.ToSlash(content.URL.Path) prefixPath = filepath.ToSlash(prefixPath) + // Trim prefix of current working dir + prefixPath = strings.TrimPrefix(prefixPath, "."+separator) // Trim prefix path from the content path. contentURL = strings.TrimPrefix(contentURL, prefixPath) content.URL.Path = contentURL