Skip to content

Commit

Permalink
replace path
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Aug 5, 2024
1 parent 39d8159 commit e98027e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/dashboard/distroutil/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package distroutil

import (
"os"
"path"
"path/filepath"

"github.com/pingcap/log"
"github.com/pingcap/tidb-dashboard/util/distro"
Expand All @@ -36,15 +36,15 @@ func MustGetResPath() string {
log.Fatal("failed to read the execution path", zap.Error(err))
return ""
}
return path.Join(path.Dir(exePath), resFolderName)
return filepath.Join(filepath.Dir(exePath), resFolderName)
}

// MustLoadAndReplaceStrings loads the distro strings from ${BinaryPath}/distro-res/strings.json
// and replace the strings in the TiDB Dashboard. If the strings file does not exist, the default
// distro string will be used.
func MustLoadAndReplaceStrings() {
resPath := MustGetResPath()
strings, err := distro.ReadResourceStringsFromFile(path.Join(resPath, stringsFileName))
strings, err := distro.ReadResourceStringsFromFile(filepath.Join(resPath, stringsFileName))
if err != nil {
log.Fatal("failed to load distro strings", zap.Error(err))
}
Expand Down

0 comments on commit e98027e

Please sign in to comment.