refactor(ui): improve path display #4222

* Updated path handling in the `manager.go` file to use `filepath` instead of `path`.
* This change ensures better compatibility across different operating systems.
This commit is contained in:
qianlifeng 2025-07-13 21:44:56 +08:00
parent 282745707c
commit 093088771c
1 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ import (
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"sync"
"wox/common"
@ -143,7 +143,7 @@ func (m *Manager) Start(ctx context.Context) error {
util.Go(ctx, "watch embed themes", func() {
workingDirectory, wdErr := os.Getwd()
if wdErr == nil {
util.WatchDirectoryChanges(ctx, path.Join(workingDirectory, "resource", "ui", "themes"), onThemeChange)
util.WatchDirectoryChanges(ctx, filepath.Join(workingDirectory, "resource", "ui", "themes"), onThemeChange)
}
})
@ -640,16 +640,16 @@ func (m *Manager) ChangeUserDataDirectory(ctx context.Context, newDirectory stri
dstPath string
}{
{
srcPath: path.Join(oldDirectory, "plugins"),
dstPath: path.Join(newDirectory, "plugins"),
srcPath: filepath.Join(oldDirectory, "plugins"),
dstPath: filepath.Join(newDirectory, "plugins"),
},
{
srcPath: path.Join(oldDirectory, "settings"),
dstPath: path.Join(newDirectory, "settings"),
srcPath: filepath.Join(oldDirectory, "settings"),
dstPath: filepath.Join(newDirectory, "settings"),
},
{
srcPath: path.Join(oldDirectory, "themes"),
dstPath: path.Join(newDirectory, "themes"),
srcPath: filepath.Join(oldDirectory, "themes"),
dstPath: filepath.Join(newDirectory, "themes"),
},
}