From c9b5c5f8fee8080361f73a1779e5d6053952da93 Mon Sep 17 00:00:00 2001 From: hailaz <739476267@qq.com> Date: Mon, 5 Feb 2024 14:41:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dgview.New=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cgfile.Pwd()=E5=8F=AF=E8=83=BD=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/gview/gview.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os/gview/gview.go b/os/gview/gview.go index c9de5947de4..3b60e8a1174 100644 --- a/os/gview/gview.go +++ b/os/gview/gview.go @@ -91,8 +91,10 @@ func New(path ...string) *View { } } else { // Dir path of working dir. - if err := view.SetPath(gfile.Pwd()); err != nil { - intlog.Errorf(context.TODO(), `%+v`, err) + if pwdPath := gfile.Pwd(); pwdPath != "" { + if err := view.SetPath(pwdPath); err != nil { + intlog.Errorf(context.TODO(), `%+v`, err) + } } // Dir path of binary. if selfPath := gfile.SelfDir(); selfPath != "" && gfile.Exists(selfPath) {