From ee77c3b113ee035fc995d038f7ca620d392313dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=9D=E5=8D=8E=E5=B8=85?= Date: Sat, 18 Feb 2023 17:53:11 +0800 Subject: [PATCH] fix: friendly tip for initial logging in [skip ci] (#3406) * refactor: friendly tip for initial logging in * fix CodeFactor issue more info pls refer to: https://segmentfault.com/a/1190000043031147 --- internal/op/path.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/op/path.go b/internal/op/path.go index 6e3dfdf7422..851c95790f3 100644 --- a/internal/op/path.go +++ b/internal/op/path.go @@ -15,6 +15,10 @@ func GetStorageAndActualPath(rawPath string) (storage driver.Driver, actualPath rawPath = utils.FixAndCleanPath(rawPath) storage = GetBalancedStorage(rawPath) if storage == nil { + if rawPath == "/" { + err = errors.New("please add a storage first.") + return + } err = errors.Errorf("can't find storage with rawPath: %s", rawPath) return }