using filepath.Join() instead of path.Join() to fix wrong filepath on Windows:
PS C:\Users\Junjie Yuan> gh auth status github.com ✓ Logged in to github.com as junjieyuan (C:\Users\Junjie Yuan\.config\gh/hosts.yml) ✓ Git operations for github.com configured to use https protocol. ✓ Token: ******************* Signed-off-by: Junjie Yuan <yuan@junjie.pro>
This commit is contained in:
parent
5821065ac0
commit
927e4c7e4d
2 changed files with 3 additions and 4 deletions
|
|
@ -7,7 +7,6 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -259,7 +258,7 @@ func checkForUpdate(currentVersion string) (*update.ReleaseInfo, error) {
|
|||
}
|
||||
|
||||
repo := updaterEnabled
|
||||
stateFilePath := path.Join(config.ConfigDir(), "state.yml")
|
||||
stateFilePath := filepath.Join(config.ConfigDir(), "state.yml")
|
||||
return update.CheckForUpdate(client, stateFilePath, repo, currentVersion)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ func ConfigDir() string {
|
|||
}
|
||||
|
||||
func ConfigFile() string {
|
||||
return path.Join(ConfigDir(), "config.yml")
|
||||
return filepath.Join(ConfigDir(), "config.yml")
|
||||
}
|
||||
|
||||
func HostsConfigFile() string {
|
||||
return path.Join(ConfigDir(), "hosts.yml")
|
||||
return filepath.Join(ConfigDir(), "hosts.yml")
|
||||
}
|
||||
|
||||
func ParseDefaultConfig() (Config, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue